Experience in C++, C#, Java and Process : Living in Montreal

* What is my technical experience as a software developer

* What I have learned in the software business

* Where I am heading to in my career

* How to process in a project

Sunday, April 24, 2005

Mix cin >> and cin.getline in C++ program

If the cin.getline() is used after cin >>, the getline may just get a '\0' bacause the last cin >> call left it.
How to fix it?

cin.ignore(100,'\n');
cin.getline(buffer1, 80, '\n');

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home