Dimitri
0
Q:

c++ delet from memory

// Delete pointer
int* ptr1 = new int;
delete ptr1;

// Delete array
int* array = new int[10];
delete[] array;  
4
// Release block of memory 
// pointed by pointer-variable
delete[] pointer-variable;  

Example:
   // It will free the entire array
   // pointed by p.
   delete[] p;
1

New to Communities?

Join the community