Skip to main content

Posts

Showing posts with the label Dynamic Memory Allocation

Dynamic Memory Allocation in C programming

             The process of allocating and freeing memory at run time is known as Dynamic Memory Allocation. This conserves the memory required by the program and returns this valuable resource to the system once the use of reserved space is utilized.          Since an array name is actually a pointer to the first element within the array, it is possible to define the array as a pointer variable rather than as a conventional array. While defining conventional array, system reserves fixed block of memory at the beginning of program execution which is inefficient but this does not occur if the array is represented in terms of a pointer variable. The use of a pointer variable to represent an array requires some type of initial memory assignment before the array elements are processed. This is known as DMA.              ...