The following code can be found in one of my functions:
// ocv is the beginning of an std::list
// fin is an ifstream open to a file with data in it
// n, itemNumber, inRoom, and inArea are of type int
// str is a char *
// line and name are of type std::string
str = new char[150];
ocv->itemNumber = n;
fin >> n;
ocv->inRoom = n;
fin >> n;
ocv->inArea = n;
fin.getline(str, 100);
fin.getline(str, 100);
line = str;
if(line!="NONE") ocv->name = line;
// ------------------------------------------- //
I've stepped through this code in the Microsoft Visual C++ Debugger and discovered that in this part of the last line:
ocv->name = line;
the compiler experiences an unhandled exception (in the header file XSTRING, _PTR is NULL, which doesn't seem right). line and str both have the string that I expected it to have in it and the code still doesn't work. The problem is that I don't know what to do about this error. I would appreciate any help. Thanks!
-Joe