How to allocate memory using malloc in c?
Answers
Answered by
1
After allocation with malloc , elements of the array are uninitialized variables. The command calloc will allocate and clear the memory in one step: int *array = calloc(10, sizeof (int)); allocates a region of memory large enough to hold 10 integers, and sets to zero all the bytes within that memoryspace.
Similar questions