1 Nov 2004 20:03
Re: buggy_double_use_of _scanf
Fábio Russo <russo <at> bluecup.com.br>
2004-11-01 19:03:50 GMT
2004-11-01 19:03:50 GMT
----- Original Message -----
From: "Glynn Clements" <glynn <at> gclements.plus.com>
To: "simon" <simon.guinot <at> laposte.net>
Cc: "linux-C-programming" <linux-c-programming <at> vger.kernel.org>
Sent: Tuesday, October 26, 2004 6:59 PM
Subject: Re: buggy_double_use_of _scanf
>
> simon wrote:
>
> > I have observe a strange scanf behaviour...
> > when using two successive scanf... the second receive a return character
> >
> > for example :
> >
> > int a;
> > char b;
> >
> > scanf ("%d", &a);
> > fflush (stdin);
> > scanf ("%c", &b);
> > fprintf (stdout, "a : %d\nb : %c\n", a, b);
> >
> > what's the problem ?
>
> What makes you think that there is a problem?
>
> What's the input? If it's a decimal number followed by newline, the
> first scanf() will return the parsed number, the second will return
(Continue reading)
RSS Feed