#include #include #include int main () { std::string line; char * filename = "example.txt"; std::ifstream myfile (filename, std::ios::in); if (myfile.is_open()) { while (! myfile.eof() ) { getline (myfile,line); std::cout << line << std::endl; } myfile.close(); } else std::cout << "Erreur à l'ouverture du fichier " << filename << std::endl;; return 0; }
- Wednesday
- December 18th, 2024
- Ajouter un cours