Archived

This topic is now archived and is closed to further replies.

phil05

problem here

Recommended Posts

std::getline(std::cin,buffer); After pressing enter, it waits for you to press another ''enter'' til it goes to the person''s response. I thought there was something like cin.put(''\n'') or something relating..?

Share this post


Link to post
Share on other sites
What compiler are you using? IIRC, MSVC 6 has a bug in it''s input stream implementation that sounds like it might cause something like that.

Share this post


Link to post
Share on other sites
err, I know I''ve come across this before, but try doing a simple cin.ignore() call right after the getline call.

Share this post


Link to post
Share on other sites
I''m using visual studio 6.0 pro. And cin.ignore() didn''t do anything, but executed fine. Still, the same problem occures.

Share this post


Link to post
Share on other sites
Write down what helps w/ this subject instead of giving me links that discuss several problems. It''s annoying, but thanks though.

Share this post


Link to post
Share on other sites
quote:
Original post by philvaira
Write down what helps w/ this subject instead of giving me links that discuss several problems. It''s annoying, but thanks though.
Are you dumb? That is a link to the fixes for the version of STL, supplied by Dinkumware, that ships with VC 6.0. It''s broken, most commonly manifest in the form of requiring an additional input character on std::getline.

What, you want me to spoonfeed you? Ingrate brat.

Share this post


Link to post
Share on other sites
That seems obvious, considering its not working for you.

Later,
Lord Hen

"I am free of all prejudices. I hate everyone equally." - W. C. Fields

[edited by - Lord Hen on December 2, 2008 2:32:49 AM]

Share this post


Link to post
Share on other sites