0

Whats wrong with this program???

#include<iostream> #include<string> using namespace std; int main(){ string name; cout << "Enter your name:\n"; cin >> name; getline (cin, name); cout<<name; return 0; }

22nd Sep 2018, 3:42 PM
Suraj Thapa
Suraj Thapa - avatar
1 Resposta
+ 1
Leave out the line cin >> name; after that the code will work fine!
22nd Sep 2018, 3:58 PM
Henry
Henry - avatar