1.41

void load()
{
//ofstream out("out.txt");
/*if (out.is_open())
{
out << "This is a line. ";
out << "This is another line. ";
out.close();
}
*/


char num[50];
char name[50];
char address[50];
ifstream in;in.open("out.txt");
if (! in.is_open())
{ cout << "Error opening file"; exit (1); }
for(int i=0;i<=4;i++){
in.getline(num,'/n');
in.getline(name,'/n');
in.getline(address,'/n');
string n(num);

}


}

原文地址:https://www.cnblogs.com/helloaworld/p/5098193.html