#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void main()
{
string buff = "D:\\test.txt";
ifstream infile;
ofstream outfile;
infile.open(buff.c_str());
if(!infile)
cout<<"error"<<buff<<endl;
while(getline(infile, buff))
cout<<buff<<endl;
infile.close();
return;
}
#include<fstream>
#include<string>
using namespace std;
void main()
{
string buff = "D:\\test.txt";
ifstream infile;
ofstream outfile;
infile.open(buff.c_str());
if(!infile)
cout<<"error"<<buff<<endl;
while(getline(infile, buff))
cout<<buff<<endl;
infile.close();
return;
}