why is it that you cannot have 2 consecutive cin.get() for a char
in a row such as this:
(it skips the second prompt and just prints first name)
Code:#include<iostream> #include<iomanip> #include<string> using namespace std; int main() { char nameF[40]; char nameL[40]; cout << "enter first name"<<endl; cin.get(nameF,40); cout << "enter first name"<<endl; cin.get(nameL,40); cout << nameF<< " " << nameL << endl; return 0; }