- In C++ input and output operations are achieved using stream concept. Stream is sequence of byte, flow of data . It makes the performance fast.
- If bytes flow from main memory to a device like printer, display or a network connection etc. This is called as output operation.
- If byte flows from device like a printer display screen or a network connection to the main memory this is called input operation.
Standard output screen
- The cout is the pre-defined object of ostream class.
- It is connected with the standard output device, which is usually a display screen.
- the cout is used in conjunction with string insertion operator (<<) ,to display the output on the console(monitor).
- cout stands for character output.
- eg. cout<<"Hello, world";
Standard input screen
- The cout is the pre-defined object of istream class.
- It is connected with the standard input device, which is usually a keyboard screen.
- the cin is used in conjunction with string extraction operator (>>) ,to take the input from the keyboard.
- cin stands for character input.
- eg. cin>>a; (a is variable)