The code I'm using is this:
string input;
cout<<"First line"<<endl;
cin>>input;
cout<<"second line: "<< input << endl;
getline(cin, input);
cout<<"third line: "<< input << endl;
However, when I input 54 say the output is this:
First line
>56
second line: 56
third line:
and the program terminates without even asking for another input. This is weird as the following does work as expected:
string input;
cout<<"First line"<<endl;
getline(cin, input);
cout<<"second line: "<< input << endl;
getline(cin, input);
cout<<"third line: "<< input << endl;
i.e. input & output is:
First line
>56
second line: 56
>45
third line: 45