Re: What's the guideline for dealing with unwanted chars in input stream?
- From: Richard Heathfield <invalid@xxxxxxxxxxxxxxx>
- Date: Sat, 31 Dec 2005 14:28:47 +0000 (UTC)
Chuck F. said:
> Richard Heathfield wrote:
>> lovecreatesbeauty said:
>>
> ... big snip ...
> >
>>> 19
>>> 20 /* remove unwanted chars in input stream here now */
>>> 21 while(getchar() != '\n'); //intended null loop body
>>
>> This won't work, because it will keep reading and discarding
>> characters up to AND INCLUDING the first non-newline, which is
>> presumably supposed to be data.
>
> Hunh? It will remove chars from the stream, including the '\n'.
Oops. My apologies. I read it as == for some reason.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.
- Follow-Ups:
- Re: What's the guideline for dealing with unwanted chars in input stream?
- From: slebetman@xxxxxxxxx
- Re: What's the guideline for dealing with unwanted chars in input stream?
- References:
- What's the guideline for dealing with unwanted chars in input stream?
- From: lovecreatesbeauty
- Re: What's the guideline for dealing with unwanted chars in input stream?
- From: Richard Heathfield
- Re: What's the guideline for dealing with unwanted chars in input stream?
- From: Chuck F.
- What's the guideline for dealing with unwanted chars in input stream?
- Prev by Date: Re: Adding the ability to add functions into structures?
- Next by Date: An Link Error
- Previous by thread: Re: What's the guideline for dealing with unwanted chars in input stream?
- Next by thread: Re: What's the guideline for dealing with unwanted chars in input stream?
- Index(es):
Relevant Pages
|
|