This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

unbuffered input


How do I do unbuffered input with cin in gcc?

I've looked at unitbuf and cin.rdbuf()->setbuf(), but with no luck.

I want cin only to read the characters from the stdin file, that I ask 
it to. If I read a character, at most one character is read from the 
file. If I do getline(), at most one line is read from the stdin file. 
In other words, cin.rdbuf()->in_avail() should always be 0.

/David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]