Learn basic concept of c , c++ and python programming in regularcodes.com
Dynamic array memory allocation of C ?
C programming are provide following function to create dynamic memory allocation .
1) malloc: malloc function are use to create dynamic memory allocation of heap area. and there are allocated memory value is to Garbage value
Syntax of malloc()
2) calloc: calloc function are used to create dynamic memory allocation of heap area. And assign memory value is zero(0).
Syntax of calloc()
3) realloc: Change the size of previously allocated memory space.
Syntax of realloc()
4) free: Release the space of allocated memory.
Syntax of free()
Assume that create dynamic array of size 10. And assign array element
View structure of this process.
Below in C program create dynamic array using malloc function. And inserting array element.
View execution process.