Basic Input/Output Flashcards
Be able to describe basic i/o to someone else
What is the difference between an Input Stream and an Output Stream?
Input stream = the direction of the flow of bytes is from the device (e.g. keyboard) —-» main memory.
Output stream = the flow of bytes from main memory —-» device (e.g. computer screen).
Describe the header file used for standard i/o streams.
Its called <iostream>.
It contains definitions of objects like: cout, cin, cerr*, clog**.</iostream>
- The unbuffered standard error stream used to output them.
** Similar to cerr, but output is stored in memory temporarily before being written.
What is the header file called for i/o stream manipulators? Describe it.
Its called <iomanip>.</iomanip>
The file contains definitions of obejcts like setw, setprecision, etc.
Manipulating the streams = changing how the data is formatted (e.g. its precision, alignment, etc).
What is <fstream> used for?</fstream>
Used to handle the data being read from a file as input or data being written into the file as output.