data structures using for( ; ; ++printf("\ enter the value % of the array" )scanf("% "&arr[ ])printf("\ the array contains \ ")for( ; ; ++printf("% "arr[ ])return now let us also see how we can allocate memory using the calloc function the calloc(function accepts two parameters--num and sizewhere num is the number of elements to be allocated and size is the size of elements the following program demonstrates the use of calloc(to dynamically allocate space for an integer array #include #include int main (int ,nint *arrprintf ("\ enter the number of elements")scanf("% ",& )arr (int*calloc( ,sizeof(int))if (arr==nullexit ( )printf("\ enter the % values to be stored in the array" )for ( ni++scanf ("% ",&arr[ ])printf ("\ you have entered")for( ni++printf ("% ",arr[ ])free(arr)return releasing the used space when variable is allocated space during the compile timethen the memory used by that variable is automatically released by the system in accordance with its storage class but when we dynamically allocate memory then it is our responsibility to release the space when it is not required this is even more important when the storage space is limited thereforeif we no longer need the data stored in particular block of memory and we do not intend to use that block for storing any other informationthen as good programming practice we must release that block of memory for future useusing the free function the general syntax of the free()function isfree(ptr)where ptr is pointer that has been created by using malloc(or calloc(when memory is deallocated using free()it is returned back to the free list within the heap to alter the size of allocated memory at times the memory allocated by using calloc(or malloc(might be insufficient or in excess in both the situations we can always use realloc(to change the memory size already allocated by calloc(and malloc(this process is called reallocation of memory the general syntax for realloc(can be given as