Which of the following operator is used to release the dynamically allocated memory in CPP? Select one: a. free b. delete c. both b and c d. remove code example
Example: c++ delet from memory
// Delete pointer
int* ptr1 = new int;
delete ptr1;
// Delete array
int* array = new int[10];
delete[] array;