J
JustSomeGuy
My question is on the delete syntax
If I allocate a buffer as follows:
unsigned char * buffer = new unsigned char[10];
Then I was told I needed to delete the buffer as:
delete [] buffer;
However I was using:
delete buffer;
1) Which is correct?
2) whats the difference
3) Why didn't I detect any memory leaks?
If I allocate a buffer as follows:
unsigned char * buffer = new unsigned char[10];
Then I was told I needed to delete the buffer as:
delete [] buffer;
However I was using:
delete buffer;
1) Which is correct?
2) whats the difference
3) Why didn't I detect any memory leaks?