Mail Archives: djgpp/2001/04/17/11:01:57
Michael Ahumibe wrote:
>
> Can someone tell me what's wrong? or if there is a work around.
As said before fflush(stdin) isn't supposed to clear the input; I
believe
that's a Borlandism (or a Microsoftism, or both).
But IIRC you can use the '%*c' specifier to read any number of
characters
(effectively clearing the input), without placing them into memory.
So scanf ("%d%*c", &age) should read '20' into age and discard the rest.
--
Tim Van Holder - Falcon Software N.V.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
This message was posted using plain text. I do not endorse any
products or services that may be hyperlinked to this message.
- Raw text -