C program to declare memory for an integer variable dynamically
This program is an example of Dynamic Memory Allocation. Here, you will learn how to declare memory at run time for an integer variable? Here we are using malloc() function, which is a predefined function of stdlib.h header file, that is used to declare memory or blocks of memory.
In this example, there is an integer pointer and memory for an integer variable is going to be declaring at run time and the address of dynamically allocated memory will be assigned to the integer pointer. By using this integer pointer we will read an integer number and print the value on the standard output device.