Filters
Question type

Study Flashcards

All of the following are true of an ostringstream object except that:


A) It uses a string to store output data.
B) A stream insertion operation cannot be used to append additional data to it.
C) The string data it stores is dynamically allocated.
D) The data it stores can be accessed using the function str.

E) B) and C)
F) None of the above

Correct Answer

verifed

verified

Which function changes the actual string stored in the string object (i.e., is not a const member function) ?


A) length
B) empty
C) capacity
D) resize

E) C) and D)
F) B) and C)

Correct Answer

verifed

verified

The function call string1.erase(5) will:


A) Return a copy of string1 minus the character that occupied position 5.
B) Erase all characters up to and including the character in position 5 from string1.
C) Erase all characters starting from and including the character in position 5 to the end of string1.
D) Return a copy of string1 minus every fifth character.

E) C) and D)
F) None of the above

Correct Answer

verifed

verified

Which of the following would not return string::npos when used on the string s which contains "rack":


A) s.find_first_not_of("crackling") ;
B) s.find_first_not_of("packrat") ;
C) s.rfind("car") ;
D) s.find("ack") ;

E) B) and D)
F) B) and C)

Correct Answer

verifed

verified

Which of the following searches through a string object from right-to-left?


A) find
B) find_first_of
C) find_last_of
D) find_first_not_of

E) A) and B)
F) A) and D)

Correct Answer

verifed

verified

Which of the following is not overloaded for strings?


A) -=
B) >>
C) +=
D) getline()

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

Which of the following does not apply to an istringstream object?


A) Data is stored in the object as characters.
B) Input from the object works identically to input from any file stream.
C) Data in a string can be appended to it.
D) It is used to inputs data from a string in memory to program variables.

E) None of the above
F) All of the above

Correct Answer

verifed

verified

Class string has member function __________ to interchange the data stored in two string objects


A) exchange
B) switch
C) swap
D) copyto

E) A) and C)
F) None of the above

Correct Answer

verifed

verified

Showing 21 - 28 of 28

Related Exams

Show Answer