Exam 8: Strings and Vectors

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

strcmpfirst,second)returns

(Multiple Choice)
4.9/5
(33)

If the name of a file to open is in the string variable name fileName,which of the following will correctly open the file for output?

(Multiple Choice)
4.9/5
(39)

How can you assign the value "toaster" to a c-string name str of size 10?

(Multiple Choice)
4.9/5
(35)

The character '\0' is called the __________ character.

(Short Answer)
4.9/5
(43)

A vector v will automatically increase the allocated size when more than v.size )elements are inserted with v.push_back newElement).

(True/False)
4.7/5
(32)

The declaration of an STL vector doubleVec that can hold values of type double,one writes ______________.

(Short Answer)
4.7/5
(38)

All c-strings must be terminated by ________

(Short Answer)
4.9/5
(43)

The notation vector<Base_Type> means that the vector is

(Multiple Choice)
4.7/5
(38)

What is the difference between strcat and strncat?

(Essay)
4.7/5
(41)

Given the following code,what is the correct statement to insert the string str2 into str1,directly after the 'd'? String str1="abcdefg"; String str2="ABCDE";

(Multiple Choice)
4.9/5
(35)

If the capacity of a vector named names is 20 and the size of names is 19,which of the following statements are legal?

(Multiple Choice)
4.8/5
(31)

What is the value of numbers.size)after the following code? Vector<float> numbers; Numbers.reserve100)

(Multiple Choice)
4.8/5
(35)

You can explicitly use the vector member function resize to increase the capacity of a vector.

(True/False)
4.8/5
(30)

What is wrong with the following attempted c-string declaration and initialization? Char str1[5]={'a','b','c'};

(Multiple Choice)
4.9/5
(40)

When a vector is assigned to another vector

(Multiple Choice)
4.7/5
(42)

Vector assignment is well behaved.

(True/False)
4.9/5
(35)

To add an element to a vector of integers named numbers at the next available position in the vector,you would use:

(Multiple Choice)
4.9/5
(43)

Vectors can have any type as the base type

(True/False)
4.9/5
(29)

Which assignment statements will copy the value " toaster" into a string variable str1)?

(Multiple Choice)
4.9/5
(40)

If a vector named numbers has 20 elements in it,what is the result of executing the following statement? Numbers.resize10);

(Multiple Choice)
4.8/5
(25)
Showing 21 - 40 of 63
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)