468,241 Members | 1,718 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,241 developers. It's quick & easy.

Help with console problems

Hello!!

I'm doing a program with C++. First I couldn't see the results because
the console close. After a little research I found that I can use a
cin.get() or a getch() and that works fine. I mean my program print a
line and is waitting for an input, but after I write something and
press enter the console closes eventought it has getch() or a
cin.get() on the next instruccion.

I know this is a dumb question but I can't find a solution. Any help
would be appreciate!!

Thanks!!!

Feb 8 '06 #1
2 1198
Hugo wrote:
I'm doing a program with C++. First I couldn't see the results because
the console close. After a little research I found that I can use a
cin.get() or a getch() and that works fine. I mean my program print a
line and is waitting for an input, but after I write something and
press enter the console closes eventought it has getch() or a
cin.get() on the next instruccion.

I know this is a dumb question but I can't find a solution. Any help
would be appreciate!!


IIRC, this is covered in the FAQ. Something about 'ignore' before the
'get'... What happens is that your "Enter" character is still in the
buffer when you try to tell it to wait...

V
--
Please remove capital As from my address when replying by mail
Feb 8 '06 #2
I'll review the FAQ!! Thanks a lot Victor! I have had this problem for
many days!!!

Feb 9 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by 0k | last post: by
16 posts views Thread by Simon | last post: by
5 posts views Thread by Chua Wen Ching | last post: by
5 posts views Thread by Matthew Speed | last post: by
1 post views Thread by Cory Koski | last post: by
3 posts views Thread by Andrew Ducker | last post: by
22 posts views Thread by j1mb0jay | last post: by
7 posts views Thread by Just Me | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.