#include <fstream> #include <iostream> #include<string> using namespace std; std::string tmp; std::ifstream infile("d:/aa.txt"); if ( !infile ) return; while (getline(infile,tmp,'\n')) { cout<<tmp.c_str()<<std::endl; } infile.close();
#include <fstream> #include <iostream> #include<string> using namespace std; std::string tmp; std::ifstream infile("d:/aa.txt"); if ( !infile ) return; while (getline(infile,tmp,'\n')) { cout<<tmp.c_str()<<std::endl; } infile.close();