Must be a simple answer but I am at a loss, here is the code that is returning an error. I have tried with and without the starting slash.
I won't know the full path, I want it to be relative from the exe, and that is the relative path. I tried escaping the slashes.
My problem is that i get "error opening file" when the file is there. why is it failing?
ifstream myFile("/LOGS/ex090716.txt");
if (myFile.fail()) {cout << "Error opening file";}
else
{
cout << "File opened... \n";
//string line;
//while( getline(myFile, line) ) {
// cmatch results;
// regex rx("(p|q)(=)([^ %]*)");
// regex_search(line.c_str(), results, rx);
// string referringWords = results[3];
//}
myFile.close();
}
thank you