The effective result is the allocation of an zero-initialized memory block of (num * size) bytes.
- Number of elements to be allocated.
- Size of elements.
Return ValueA pointer to the memory block allocated by the function.
The type of this pointer is always void*, which can be cast to the desired type of data pointer in order to be dereferenceable.
If the function failed to allocate the requested block of memory, a NULL pointer is returned.
This program simply stores numbers and then prints them out. But the number of items it stores can be adapted each time the program is executed because it allocates as much dynamic memory as needed during runtime.
|free||Deallocate space in memory (function)|
|malloc||Allocate memory block (function)|
|realloc||Reallocate memory block (function)|