Hi, i am a stud in software engineering course and i are having with getline use in C++. I wrote a variables 'name' and cin>>John Labu and i use getline(cin,name) to get the entire line.. but frustratingly... i only get Labu in cout<<name.. and ive been trying to find the problem.... hope someone can help me with this😥
12/11/2018 2:35:53 PM
Abdul Malik4 Answers
New AnswerCan you show the code.. It should be something like string name; getline(cin, name); cin >> name; //Your name here cout<<name;
Abdul Malik Make it like how I've stated.. you should ask for input after getline(cin, name) That should work
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message