A
Als
1. <fstream>
ifstream test_file ("test.txt");
test_file >> user_name >> password;
This chained reading in of the text file is not so understandable to me.
Could someone share some insights on it?
2.<sstream>
Why is "ostringstream" needed in STL? When should use it? Has it so
different usage than string?
3.
string name;
cin >> name;
getline (cin, name);
cout << name << endl;
Why "getline" since cin >> name there already?
Why does the output "Doe" instead of "Joe Doe" when input is "Joe Doe"?
Any comment is appreciated.
ifstream test_file ("test.txt");
test_file >> user_name >> password;
This chained reading in of the text file is not so understandable to me.
Could someone share some insights on it?
2.<sstream>
Why is "ostringstream" needed in STL? When should use it? Has it so
different usage than string?
3.
string name;
cin >> name;
getline (cin, name);
cout << name << endl;
Why "getline" since cin >> name there already?
Why does the output "Doe" instead of "Joe Doe" when input is "Joe Doe"?
Any comment is appreciated.