I\'m new to C++, and I\'m confused about arrays and pointers. Could someone tell me how I can properly delete a pointer. Like for example,
int *foo; foo = ne
If you allocate an array of objects using the new [] operator then you must use the delete [] operator and therefore the non-array new can only be used with the non-array delete.
new []
delete []
new
delete
int *a = new int[10]; int *b = new int; delete [] a; delete b;