Console I/O in C programming :
In order to keep C Programming language compact, Dennis Ritchie removed anything related to the input or output from the definition of the language. Therefore, C has no provisions for input and output of data from input and output devices.
In order to solve this little discrepancy, the C developers developed several standard input and output functions and placed them in C libraries. All these libraries are accessible by all the C compilers.
Also, this implies that the way different operating systems use these I/O functions will differ for every operating system. The printf() function for a DOS-based compiler has been written keeping in mind the way a DOS-based compiler would display the output. There are required differences in the Windows and Unix based compilers as well. Thus, this feature is OS dependent.
Types of input /output functions :
A lot of Input/output functions have been defined in the standard libraries. These can be classified as follows:
Console I/O function : These functions allow us to receive input from the input devices like keyboard and provide output to the output devices like the Visual Display Unit.
File I/O functions: These functions allow us to access the hard disk or floppy disk to perform input and output.
Console I/O functions :
A console comprises the VDS and the keyboard. The Console Input and Output functions can be classified into two categories:
- Formatted console I/O functions : These functions allow the user to format the input from the keyboard and the output displayed in the desired manner.
- Unformatted console I/O functions : These functions do not allow the user this feature.