Wtf is this? Just call c_str() and be done with it...(assuming you are using std::strings) |
Hmmm. Didn't know this function existed - to be honest, a lot of my experience with C++ comes with a semester-long class and a crappy teacher who was replaced with a teacher who had to clean up the damage. Most of my string experience is limited to c strings.
Thanks for the heads up, firedraco and kbw. I'll check it again and post my results (or edit this one).
Edit: Replaced the chunk of code highlighted in firedraco's post with this:
1 2 3 4 5
|
char *FileNameArray, *SchemaNameArray;
FileNameArray = new char [FileName.length() + 1];
SchemaNameArray = new char [SchemaName.length() + 1];
strcpy (FileNameArray, FileName.c_str());
strcpy (SchemaNameArray, SchemaName.c_str());
| |
I'm still running into a fatal runtime error...
Edit 2: I inserted an 'is_open' check before all the operations commence; however, the program dies in between the final user input/program output and the is_open check, indicating that there's something wrong either in the string construction (i add strings together to create the tag) or still something weird in the part I thought I fixed with firedraco's and kbw's help.
Edit 3: (Jeez, so many updates...I should have condensed this, sorry.) The construction of strings has no problems - I used an output to check that; neither does the usage of c_str(). I edited out the physical tag addition with the /**/ system and compiled/ran; the program can open, read, and close without any problems. This leads me to the conclusion that my system for adding tags is jacked up. Argh, time to fix it.