malloc() function
The library function malloc() (in <stdlib.h>) asks for memory from the computer system of required size in units of byte. If the allocation is successful, it returns a pointer to the newly allocated memory. If malloc is unable to allocate the requested storage, it returns NULL.
#include <stdlib.h>
. . .
int *ptr;
ptr = malloc(sizeof(int));