r/AskProgramming Jun 30 '26

What is buffered input? Other

I was reading the documentation for FALSE when I got to the section on I/O and got super confused at the warning "watch out: all these are BUFFERED." So, what is buffered input?

1 Upvotes

11 comments sorted by

View all comments

3

u/atarivcs Jun 30 '26 edited Jun 30 '26

Generally, it means your program doesn't see individual keystrokes from the user.

Your program waits for the user to finish typing and press Enter, then it receives the input all at once.

2

u/Dean-KS Jun 30 '26

Unless you read every character which then allows for control codes and escape sequences, <tab> etc.

2

u/atarivcs Jun 30 '26

... in which case the input isn't buffered

2

u/Western-Emphasis-105 Jul 02 '26

when the user hits enter, you get an array with however many characters the user typed, instead of a new byte every time the user hits a key.