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
You walked in the front door and left it open. Then you walked through to the back door and tried to close it but you smashed it because it was already closed.
foo = new int [10]; // so when you open the front door
delete [] foo; // please remember to close the front door.
foo = new int; // and when you open the back door
delete foo; // please remember to close the back door.
Don't mix them up!