Dynamic Memory Allocation – tccicomputercoaching.com
The process of allocating memory during program execution is called dynamic memory allocation.
DYNAMIC MEMORY ALLOCATION FUNCTIONS IN C:
C language offers 4 dynamic memory allocation functions. They are,
1. malloc () function is used to allocate space in memory during the execution of the program.
malloc () malloc (number *sizeof(int));
2. calloc () function is also like malloc () function. But calloc () initializes the allocated memory to zero.
calloc () calloc (number, sizeof(int));
3. realloc ()
realloc is used to update size of data.
realloc (pointer_name, number * sizeof(int));
4. free ()
free is used to release the memory allocated by malloc and calloc function.
This basic knowledge will help students to learn advance programming concepts.
To enrol at TCCI.
Call us @ 9825618292
Visit us @ http://tccicomputercoaching.com/