I have tough problems while trying to de-allocate this pointer.
I'm having this error:
error for object 0x10007fd20: pointer being freed was not allocated
I have the following structure:
char * doSomething() //I cannot change this method.
{
return "hello world";
};
int main ()
{
char * var= doSomething();
cout<< var<<endl;
delete[] var;
};
Please consider that I cannot use string, because I'm not being provided with the doSomething method
. As I'm using it a lot.. after a while the app collapses because of the RAM memory use.