![]() |
What is a malloc function in c programming?In: C Programming |
[Edit] |
Answer
Malloc is the memory allocation function in C. C requires memory to be manully allocated for some data structures. Malloc will allocate a section of memory of a given size for the data structure. Hope that helps. Sorry I don't have more information off hand. Happy programming.
Jimbobbery
Answer
The malloc() function allocates memory from the heap. Global and static variables are placed in similar global memory. Automatic variables, declared inside functions, are placed on the heap.
This is somewhat compiler dependent.
First answer by Das Jimbobbery. Last edit by Simpleaspossible. Contributor trust: 49 [recommend contributor]. Question popularity: 13 [recommend question]





