In my code I am trying to create a file and write to it.
std::ofstream saveFile("file.txt");
ofstream << "test" << endl;
Works perfect! But,
std::string fileName = "file.txt"
std::ofstream saveFile(filename.c_str());
ofstream << "test" << endl;
I've tried with and without c_str(), with no luck. There are no errors. But ofstream.good() returns false.
Aucun commentaire:
Enregistrer un commentaire