Answers for "delete dynamic array c++"

C++
7

c++ delet from memory

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

// Delete array
int* array = new int[10];
delete[] array;
Posted by: Guest on March-09-2020
2

c++ delete dynamically allocated array

int length = 69;
int * numbers = new int[length];
delete[] numbers;
Posted by: Guest on March-20-2020
0

delete dynamic array c++

int* v=new int[10];  // Creating a dynamic array

delete[] v; // delete the dynamic array

v=nullptr; //recommended
Posted by: Guest on March-15-2021

Browse Popular Code Answers by Language