sungetc

Joe Buck Joe.Buck@synopsys.com
Wed Apr 17 17:11:00 GMT 2002


> >> So if there's already a putback position, sungetc returns the character
> >> ungotten.  If there isn't one, but we can create one, sungetc returns some
> >> random non-EOF value. ...

I wrote:
> > You can usefully use sungetc if you know that there is never more than
> > one pushback character...

Jason wrote:
> I think you misunderstood my point.  I was complaining about the
> specification of the return value, not the size of the putback buffer.
> IMO, if we can put back a character, we should return that character.

Yes, you're right, I was confused by the language about putback positions,
I thought it meant that the putback buffer was already full.

> Currently, if we do a putback when we are at the beginning of the read
> buffer, we return 0, whereas if we are in the middle of the read buffer we
> return the character.

I agree that this seems odd and useless.




More information about the Libstdc++ mailing list