c++ - Difference between putback() and unget() -


i'm using standard iostream input file, , i'm confused unget() versus putback(character). seems me documentation these functions identical, unget() remembers character put in, i'm nervous. i've used putback(character), character last read character , i've been thinking changing unget(). putback(character) identical unget(), if character last read character?

you can't lie unget(). "ungets" last-read character. can lie putback(c). can "putback" character other last-read character. putting character other last-read character can useful.

also, if underlying read buffer have buffering capability, can "putback" more 1 character. think ungetc() limited 1 character.

edit
nope. looks unget() can go far putback().


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -