Allocation of memory during execution is called dynamic memory allocation. C provides library functions to allocate and free memory dynamically during program execution. Dynamic memory is allocated on the heap by the system.
#include "stdlib.h"
int *ptr;
ptr = (int *)malloc(sizeof(int));