+ 2
why it is necessary to use heap for local variable?
we know stack is for local variable then why we use heap
1 Respuesta
+ 1
1. Stack size limit depends on OS, not on available memory (this can be an issue sometimes).
2. You cannot change a size of variable hold in Stack (you cannot realloc() your variable)