program to easily understand dynamic memory allocation in c code example
Example: dynamic memory allocation
int *p = new int; // request memory
*p = 5; // store value
cout << *p << endl; // Output is 5
delete p; // free up the memory
cout << *p << endl; // Output is 0