[CPP]getline

#include<iostream>
#include<fstream>
#include<string>

using namespace std;

int main(int argc,const char* argv[])
{
	ifstream infile(argv[1]);
	if(infile.bad()) return -1;
	string ss;
	while(getline(infile,ss)) cout << ss << endl;
	return 0;
}

你可能感兴趣的:([CPP]getline)