which is the difference?

Hello.
Which is the difference between "delete" and "delete []".For example if i declare
int **p=new int *[6]; and then i use "delete p" or "delete p[]" .The compiler returns me no error for each of the options i choose (but there must be some reason of using delete p and not delete [] p).
Ok.

Example
class* x = new class;

you would delete like this
delete class;


Example 2

class* x = new class[100] // points to an array of 100 classes
you must delete like this or you will have a memory leak
delete [] class;
Oh i see,thank you my friend!
Topic archived. No new replies allowed.