memory allocation new code example
Example 1: c++ delete dynamically allocated array
int length = 69;
int * numbers = new int[length];
delete[] numbers;
Example 2: dynamic memory allocation in c++
char* pvalue = NULL; // Pointer initialized with null
pvalue = new char[20]; // Request memory for the variable