A
aegis
Consider the following:
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
int a, b, c;
cin >> a; cin >> b; cin >> c;
string s;
getline(cin, s);
return 0;
}
is there a newline hanging around cin's input buffer
for getline to accept and return immediately?
Because that is how the programming is behaving.
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
int a, b, c;
cin >> a; cin >> b; cin >> c;
string s;
getline(cin, s);
return 0;
}
is there a newline hanging around cin's input buffer
for getline to accept and return immediately?
Because that is how the programming is behaving.