Computer Science, asked by niangbawi664, 1 year ago

How to allocate memory using malloc in c?

Answers

Answered by PrinceRajj
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