I've tried using delete[] but my MSVC6 compiler says it's not a pointer. Is there another solution to delete string variables (let's say using string.h).
I've tried using delete[] but my MSVC6 compiler says it's not a pointer. Is there another solution to delete string variables (let's say using string.h).
You only need to use delete if you have defined your string var. as a dynamic pointer.
eg.
by the sounds of it you haven't, so remove the delete code.Code:string *myStringOne; string *myStringTwo; myStringOne = new string; myStringTwo = new string[999]; // deleting at a later stage delete myStringOne; delete [] myStringTwo;
-----------------------------------------------
everready
To code, or not to code, that is the question.
Well the answer is 'TO CODE' of cause