What is the difference between delete and delete[] in C++ ?
The correct answer is C) delete is used to delete a single object whereas delete[] is used to delete multiple objects.
delete: The delete operator is used to deallocate memory that was allocated for a single object using new. For example
int* singleObject = new int; delete singleObject;delete[]: The delete[] operator is used to deallocate memory that was allocated for an array of objects using new[]. For example
int* arrayObjects = new int[10]; delete[] arrayObjects;