C standard file IO stream

File I/O Streams in C Programming Language :

  1. In C all input and output is done with streams
  2. Stream is nothing but the sequence of bytes of data
  3. A sequence of bytes flowing into program is called input stream
  4. A sequence of bytes flowing out of the program is called output stream
  5. Use of Stream make I/O machine independent.

Predefined Streams :

stdin Standard Input
stdout Standard Output
stderr Standard Error

Standard Input and Output Streams in C Programming

Standard Input Stream Device :

  1. stdin stands for (Standard Input)
  2. Keyboard is standard input device .
  3. Standard input is data (Often Text) going into a program.
  4. The program requests data transfers by use of the read operation.
  5. Not all programs require input.

Standard Output Stream Device :

  1. stdout stands for (Standard Output)
  2. Screen(Monitor) is standard output device .
  3. Standard output is data (Often Text) going out from a program.
  4. The program sends data to output device by using write operation.

Difference Between Std. Input and Output Stream Devices :

Point Std i/p Stream Device Standard o/p Stream Device
Stands For Standard Input Standard Output
Example Keyboard Screen/Monitor
Data Flow Data (Often Text) going into a program data (Often Text) going out from a program
Operation Read Operation Write Operation

Some Important Summary :

Point Input Stream Output Stream
Standard Device 1 Keyboard Screen
Standard Device 2 Scanner Printer
IO Function scanf and gets printf and puts
IO Operation Read Write
Data Data goes from stream data comes into stream