Re: peek at stdin, flush stdin

From: Johnathan Doe (johnathan_doe_at__NOSPAM_fastmail.com.au_I_SAID_NO_SPAM!)
Date: 05/23/04


Date: Sun, 23 May 2004 20:46:33 +1000

Thomas stegen wrote:

Thankyou for teaching me about [^\n] : it's not in my textbook!

Kind Regards.

> char c;
> scanf("%c%*[^\n]%*c", &c);
>
> Should do the trick. It does not clear stdin if more than
> one line was entered in some way.
>



Relevant Pages