📜  getline of file C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:49.555000             🧑  作者: Mango

代码示例1
ifstream inFile;
string name;
int age;

inFile.open("file.txt");

getline(inFile, name); 
inFile >> age; 

cout << name << endl;
cout << age << endl;  

inFile.close();