Execution of cin is skipped... | Sololearn: Learn to code for FREE!


Execution of cin is skipped...

While accepting a string i am unable to do it. cin>>name; this line gets skipped and the next cout works

10/27/2017 1:38:12 PM


2 Answers

New Answer


to read a string cin>> does not work . Rather use this : int main() { char name[200],ch; // or you could use char *name = new char[200]; cout<<"\n Enter your name : "; cin.get(ch); cin.getline(name,200); cout<<name; return 0; }