This chapter is mainly about the concept of input and output streams and the simple application of input and output.
The concept that has been said:
• Buffer
When you use the console program to write a program, when you use the Input function to enter content, the input will always complete the input after you type the newline character \ n, and the final input will not be determined either by adding or changing the contents of the input. In the game or in the real-time key operation, any button, touch and mobile devices will immediately produce corresponding response. The two methods are buffered input and non-buffered input, respectively.
• redirect
For a computer, the form of input and output is not unique. Input can be from the keyboard, files, and perhaps also from what gravitational waves, short wave, medium wave, long wave, small cosmic chakra, the output of the purpose of equipment is also diverse. So it's too cumbersome and specific for the language standard, and it doesn't matter. For the C language, the language standard introduces a concept of "flow", all inputs and outputs are abstracted into a unified "thing" to operate, do not need to tube specific equipment and location, like a river, a lot of tributaries, but the tributary of the water once flowed into the main river, that from the downstream view of the water is main river water, not related to tributaries. With the concept of "flow", computer programming allows for uniform operation of inputs and outputs. Different types of input sources can be manually or automatically change the input to run the program. Any output device that can be used can also be programmed to output the required content. That's the redirect.
Redirected applications can be implemented in the operating system using the command line. The book uses Linux and DOS for example, no practice, so don't say it.
· Eof
For a file, the contents and size of the file can be arbitrary. For systems and programs, there are several ways to determine the end of a file. One is judged by the size of the file, the other is the EOF symbol at the end of the file's content, and the end of the file is found by detecting EOF. The actual value of the EOF (end of file) does not need to be considered, and the difference between the operating system and the language becomes affected by the specific value of EOF, and the EOF in C is defined as-1 in stdio.h.
C Primer Plus Unit eighth-character input/output confirmation