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
SUDEEP KUMAR SAHOO2 Answers
New Answerto 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; }
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message