this post was submitted on 31 May 2026
6 points (100.0% liked)
C Programming Language
1309 readers
2 users here now
Welcome to the C community!
C is quirky, flawed, and an enormous success.
... When I read commentary about suggestions for where C should go, I often think back and give thanks that it wasn't developed under the advice of a worldwide crowd.
... The only way to learn a new programming language is by writing programs in it.
- irc: #c
๐ https://en.cppreference.com/w/c
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I'm too lazy to confirm, but I think scanf (as well as many other I/O functions) works on top of the buffered input. I.e. when you scanned only one character on the first run of scanf but there are more left in the buffer, then subsequent calls will read from that buffer, e.g.
In general you have two options:
For both cases, do your research on how to do it :) That K&R from above should be a great start indeed.
Thanks very much! I had no idea there is such a thing as "unbuffered I/O". I'll look into it. :)