We had a computers lesson yesterday and our teacher was explaining pointers and how to allocate memory.. etc.. using new and delete([]).
At one point, she said:
I always thought it was delete[] strng, since strng is allocated as an array? I didnt want to correct the teacher since well, i didnt want to be wrong, but im almost 100% sure that its delete[] and not delete...Code:char* strng = new char[astring.getCount() + 1]; for (i = 0; i < astring.getCount(); i++) { strng[i] = astring.getCharacter(i); } strng[i] = '\0'; //do something with strng delete strng;