[gameprogrammer] Re: Simple C++ Program
- From: "alexandros mouzakidis" <greatalexandros@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Tue, 26 Sep 2006 11:46:58 +0300
use fflush( STDIN );
After any input
And neve use getchar() of scanff combine with cin. Excepti if you use a
synchronize method of cin. You should read a tutorial about stin and stdout
On 9/26/06, Dominic McDonnell <telarau@xxxxxxxxxxxx> wrote:
The earlier input has left a carriage return in the input queue. Call
getchar() or similar to get rid of it.
D McDonnell
Craig Chambers wrote:
>hi,
>this may be a little off topic, but i have a small
>problem. every time i write a small program (i'm just
>learning too) and i add a scanf() or cin line to the
>end of my program to make the program wait so i can
>see the results, it ignores the first one, so i have
>to put 2!!!!!!! is this wierd or am i doing somthing
>wrong?
>it only happens if earlier in the program i have asked
>for user input. I'm using bloodshed's devc++. am i
>doing something wrong with my user input earlier in
>the program?
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam? Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
>
>
>---------------------
>To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
>
>
>
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- References:
- [gameprogrammer] Re: Simple C++ Program
- From: Craig Chambers
- [gameprogrammer] Re: Simple C++ Program
- From: Dominic McDonnell
Other related posts:
- » [gameprogrammer] Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
- » [gameprogrammer] Re: Simple C++ Program
The earlier input has left a carriage return in the input queue. Call getchar() or similar to get rid of it. D McDonnell
Craig Chambers wrote:
>hi, >this may be a little off topic, but i have a small >problem. every time i write a small program (i'm just >learning too) and i add a scanf() or cin line to the >end of my program to make the program wait so i can >see the results, it ignores the first one, so i have >to put 2!!!!!!! is this wierd or am i doing somthing >wrong? >it only happens if earlier in the program i have asked >for user input. I'm using bloodshed's devc++. am i >doing something wrong with my user input earlier in >the program? > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com > > >--------------------- >To unsubscribe go to http://gameprogrammer.com/mailinglist.html > > > > >
--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- [gameprogrammer] Re: Simple C++ Program
- From: Craig Chambers
- [gameprogrammer] Re: Simple C++ Program
- From: Dominic McDonnell