Answers for "getline of file C++"

C++
0

getline of file C++

ifstream inFile;
string name;
int age;

inFile.open("file.txt");

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

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

inFile.close();
Posted by: Guest on October-09-2020

Browse Popular Code Answers by Language