Code:
while(!fin.getline(info, 500).eof() )
{
arrayoffeat = new char * [10];
*arrayoffeat = new char[100];
parseinputfromfile(info, arrayoffeat)
myclass[i].setfeat(arrayoffeat);
delete [] *arrayoffeat;
delete [] arrayoffeat;
++i;
}
Hey there! I'm having trouble getting my memory to deallocate. pareinputfromfile function just goes through info, parses the information and loads up arrayoffeat. Then myclass is just an array of classes that sets the features into a private data structure. My problem is on outputting the array of characters to stdout. I'm getting garbage from the previous read in. So, its seems like I need to deallocate the memory after every rotation. I have put up my attempt at delete-ing the array of arrays, unfortantly it didn't work. I tried delete [] array[i]; well, it didn't like that.
Any help would be greatly appriciated!
Thanks!