How to allocate memory dynamically for array in c?
Answers
Answered by
1
The memory set aside by malloc is not initialized and may contain cruft: the remnants of previously used and discarded data. After allocation with malloc , elements of the array are uninitialized variables. The command calloc will allocate and clear thememory in one step: int *array = calloc(10, sizeof (int));
Similar questions
Computer Science,
7 months ago
Geography,
7 months ago
English,
7 months ago
Math,
1 year ago
Music,
1 year ago