C Programming :: Dynamic Memory Allocation - Discussion
Home > C Programming > Dynamic Memory Allocation > MCQs Questions Discussion
16 / 18
Choose the correct option.
alloca() allocates memory from
AHeap
BReserved memory
CStack
DData Segement
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
The alloca() function allocates size bytes of space in the stack frame of the caller. This temporary space is automatically freed when the function that called alloca() returns to its caller. The alloca() function returns a pointer to the beginning of the allocated space. If the allocation causes stack overflow, program behavior is undefined.
If you are using alloca function, then you need to include below library in your program.
#include <alloca.h>
Prototype of alloca:
void *alloca(size_t size);
Read Full Answer
Report Error
Please Login First Click Here