Those are the parts of the code I have:
ifstream inFile;
inFile.open("Product1.wrl");
...
if (!inFile.is_open()){
cout << "Could not open file to read" << endl;
return 0;
}
else
while(!inFile.eof()){
getline(inFile, line);
cout << line << endl; //this statement only to chech the info stored in "line" string
if (line.find("PointSet"))
inFile >> Point1;
}
The output shows me the same string over and over again. So this means that the cursor inside the file does not proceed and getline
reads the same line.
What might be the problem of this odd behavior?
If this is relevant:
The file does open as a .txt
file and contains the exact information I need.
Okay I figured the problem:
Even after first eteration the return value of line.find("PointSet")
is: 429467295... while my line
string contains only one letter "S". Why?