Basic Input/Output Flashcards

Be able to describe basic i/o to someone else

1
Q

What is the difference between an Input Stream and an Output Stream?

A

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).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the header file used for standard i/o streams.

A

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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the header file called for i/o stream manipulators? Describe it.

A

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).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is <fstream> used for?</fstream>

A

Used to handle the data being read from a file as input or data being written into the file as output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly