1char* pvalue = NULL; // Pointer initialized with null
2pvalue = new char[20]; // Request memory for the variable
3
1// declare an int pointer
2int* pointVar;
3
4// dynamically allocate memory
5// using the new keyword
6pointVar = new int;
7
8// assign value to allocated memory
9*pointVar = 45;
10