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
Post a Comment