keywords:
Bookmark and Share



Front Back
What is a stream in C++?
It is an infinite sequence of characters from a source to a destination.
What is an input stream?
It is a stream from a source to a computer.
What is an output stream?
It is a stream from a computer to a destination.
Describe what cin is?
It stands for common input, is an input stream object, typically initialized to the standard input device, which is the keyboard.
Describe what cout is?
It stands for common output, is an output stream object, typically initialized to the standard output device, which is the screen.
Describe what the binary operator » is and how it is used.
It is called the stream extraction operator. It is used with an input stream object, such as cin, The left-side operand of » must be an input stream variable, such as cin; the right-side operand must be a variable.
Describe what the binary operator « is and how it is used.
It is called the stream insertion operator. It is used with an output stream object, such as cout, The left-side operand of « must be an output stream variable, such as cout; the right-side operand of « must be an expression or a manipulator.
When inputting data into a variable, the operator » does what?
It skips all leading whitespace characters.
To use cin and cout, the program must include what header file?
The header file iostream.
What does the get function do?
The get function is used to read data on a character-by-character basis and does not skip any whitespace characters?
What does the ignore function do?
The ignore function is used to skip data in a line?
What does the putback function do?
The putback function puts the last character retrieved by the function get back into the input stream?
What does the peek function do?
The peek function returns the next character from the input stream but does not remove the character from the input stream.
Attempting to read invalid data into a variable causes the input stream to?
Enter the fail state.
What does the function clear do?
Once an input failure has occurred,you use the function clear to restore the input stream to a working state.
What does the manipulator setprecision do?
The manipulator setprecision formats the output of floating-point numbers to a specified number of decimal places.
What does the manipulator fixed do?
The manipulator fixed outputs floating-point numbers in the fixed decimal format.
What does the manipulator showpoint do?
The manipulator showpoint outputs floating-point numbers with a decimal point and trailing zeros.
What does the manipulator setw do?
The manipulator setw formats the output of an expression in a specific number of columns; the default output is right-justifed.
What is the result if the number of columns specified in the argument of setw is less than the number of columns needed to print the value of the expression?
The output is not truncated and the output of the expression expands to the required number of columns.
What does the manipulator setfill do?
The manipulator setfill is used to fill the unused columns on an output device with a character other than a space.
What is the result if the number of columns specified in the setw manipulator exceeds the number of columns required by the next expression?
The output is right justified. To left-justify the output, you use the manipulator left.
To use the stream functions get, ignore, putback, peek, clear, and unsetf for standard I/O, the program must include the which header file?
The header file iostream.
To use the manipulators setprecision, setw, and setfill, the program must include which header file?
The header file iomanip.
What header file contains the definitions of ifstream and of stream?
The header file fstream.
Describe the use of the statement #include ?
For file I/O, you must use the statement #include to include the header file fstream in the program. You must also do the following: declare variables of type ifstream for file input and of type ofstream for file output; use open statements to open input and output files; and use «, », get, ignore, peek, putback, or clear with file stream variables.
What is the statement inFile.close(); used for?
To close a file as indicated by the ifstream variable inFile, you use the statement inFile.close();.
What is the statement outFile.close() ; used for?
To close a file as indicated by the ofstream variable outFile, you use the statement outFile.close(); . .
x of y cards