void Tutorial() {
fstream myFile;
myFile.open("Tutorial.txt", ios::in);
if (myFile.is_open()) {
string line;
while (getline(myFile, line))
{
std::cout << line << endl;
}
myFile.close();
}
}
I have a file inside the folder called tutorial.txt
, but it does not print out the characters in the console when the function is called.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.