It must point to invalid data.
Originally Posted by trenzterra
I think your whole approach is wrong. Since this is a C++ forum and not a C forum, I would assume you want a C++ solution. In that case, you should be using C++ strings, which eliminate all the problems you are having. You can then use the find() function to get the index position of the equals sign:
And, you can use the substr() function to divide up the string:
//open input file myInputFile, etc.
//read in a line of data from myInputFile and store it in the string input
int equals = input.find('=');
string program = input.substr(0,equals);
//substring from index 0 to equals--not including the char at index position equals.
string path = input.substr(equals + 1);
//substring from equals + 1 to the end of the string