Oct, hex and dec
Question: When used, the _________ stream manipulator causes positive numbers to
display with a plus sign.
Showpos
Question: The stream member function flags with a long argument sets the flags state
variable to its argument and returns its previous value.
False
Question: The stream insertion operator << and the stream-extraction operator >> are
overloaded to handle all standard data typesincluding strings and memory addresses
(stream-insertion only)and all user-defined data types.
False
Question: The stream member function flags with no arguments resets the stream's
format state
False
Question: The stream extraction operator >> can be overloaded with an operator function
that takes an istream reference and a reference to a user-defined type as arguments and
returns an istream reference.
True
Question: The stream insertion operator << can be overloaded with an operator function
that takes an istream reference and a reference to a user-defined type as arguments and
returns an istream reference
False
Question: Input with the stream extraction operator >> always skips leading white-space
characters in the input stream, by default
True
Question: The stream member function rdstate returns the current state of the stream
True
Question: The cout stream normally is connected to the display screen
True
Question: The stream member function good returns TRUE if the bad, fail and eof
member functions all return false
True
Question: The cin stream normally is connected to the display screen
False
Question: If a nonrecoverable error occurs during a stream operation, the bad member
function will return TRue
True
Question: Output to cerr is unbuffered and output to clog is buffered
True
Question: Stream manipulator showpoint forces floating-point values to print with the
default six digits of precision unless the precision value has been changed, in which case
floating-point values print with the specified precision
True
Question: The ostream member function put outputs the specified number of characters
False
Question: The stream manipulators dec, oct and hex affect only the next integer output
operation
False
Question: By default, memory addresses are displayed as long integers
falseQuestion: Output the string "Enter your name: "
cout << "Enter your name: ";
Question: Use a stream manipulator that causes the exponent in scientific notation and
the letters in hexadecimal values to print in capital letters
cout << uppercase;
Question: Output the address of the variable myString of type char *
cout << static_cast< void * >( myString );
Question: Use a stream manipulator to ensure floating-point values print in scientific
notation
cout << scientific;
Question: Output the address in variable integerPtr of type int *.
cout << integerPtr;
Question: Use a stream manipulator such that, when integer values are output, the
integer base for octal and hexadecimal values is displayed.
cout << showbase;
Question: Output the value pointed to by floatPtr of type float *.
cout << *floatPtr;
Question: Use a stream member function to set the fill character to '*' for printing in field
widths larger than the values being output. Write a separate statement to do this with a
stream manipulator
cout.fill( '*' );
cout << setfill( '*' );
Question: Output the characters '0' and 'K' in one statement with ostream function put
cout.put( '0' ).put( 'K' );
Question: Member function read cannot be used to read data from the input object cin
False
Question: The programmer must create the cin, cout, cerr and clog objects explicitly
False
Question: A program must call function close explicitly to close a file associated with an
ifstream, ofstream or fstream object.
False
Question: If the file-position pointer points to a location in a sequential file other than
the beginning of the file, the file must be closed and reopened to read from the beginning
of the file
False
Question: The ostream member function write can write to standard-output stream cout
True
Question: Data in sequential files always is updated without overwriting nearby data
False
Question: Searching all records in a random-access file to find a specific record is
unnecessary
True
Question: Records in random-access files must be of uniform length
False
Question: Member functions seekp and seekg must seek relative to the beginning of a
file
False
Question: A selection sort application would take approximately ________ times as long
to run on a 128-element vector as on a 32-element vector.