c++ delet from memory
// Delete pointer
int* ptr1 = new int;
delete ptr1;
// Delete array
int* array = new int[10];
delete[] array;
c++ delet from memory
// Delete pointer
int* ptr1 = new int;
delete ptr1;
// Delete array
int* array = new int[10];
delete[] array;
c++ delete dynamically allocated array
int length = 69;
int * numbers = new int[length];
delete[] numbers;
delete dynamic array c++
int* v=new int[10]; // Creating a dynamic array
delete[] v; // delete the dynamic array
v=nullptr; //recommended
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us