Question: are local variables stored on the stack?
Answer: All allocation made by malloc(), calloc() or realloc() are stored on the heap, while all local variables are stored on the stack. All global and static variables are stored in the data segment, while constants are stored in the code segment.