allocate memory dynamically at runtime in c++ using malloc code example Example: how to use malloc in c int* a =(int*)malloc(sizeof(int))