How are arrays stored on the stack?

advertisements

I know how Arrays stored on the heap. But how are local arrays stored on the stack. Is the complete array pushed to the stack?


Yes, the whole array is pushed on stack. Check this link to see, how the variables are allocated memory on stack https://stackoverflow.com/a/18479996/1814023