Re: peek at stdin, flush stdin
From: Johnathan Doe (johnathan_doe_at__NOSPAM_fastmail.com.au_I_SAID_NO_SPAM!)
Date: 05/23/04
- Next message: Johnathan Doe: "Re: Chaning/allocating char* function parameters"
- Previous message: Johnathan Doe: "Re: peek at stdin, flush stdin"
- In reply to: Thomas stegen: "Re: peek at stdin, flush stdin"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
>
- Next message: Johnathan Doe: "Re: Chaning/allocating char* function parameters"
- Previous message: Johnathan Doe: "Re: peek at stdin, flush stdin"
- In reply to: Thomas stegen: "Re: peek at stdin, flush stdin"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|