std::ifstream infile;
infile.open("example.txt");
if (!infile.is_open()) {
std::cout << "can't open" << std::endl;
}
I read this: unable to open file stream c++ and have tried using the full path infile.open("~/projects/example.txt");
The text file is in the same folder where the .cpp
/ .hpp
files reside.
What else could be the problem?