Exam 8: Strings and Vectors

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Vector indexing warns about out-of-bounds index values.

(True/False)
4.8/5
(37)

To compare two c-strings you use the __________ function.

(Short Answer)
4.9/5
(42)

If you want to read into a c-string, you must ensure that the user does not enter more characters than

(Multiple Choice)
4.9/5
(36)

Vectors and arrays are the same data type.

(True/False)
4.9/5
(32)

If vector v has fewer than 24 elements and you call v.resize24) the newly allocated elements are not initialized.

(True/False)
4.9/5
(38)

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.7/5
(29)

To declare a c-string and initialize it to the value of "phonebook",

(Multiple Choice)
4.7/5
(33)

To use the functions for manipulating and comparing c-strings, you must include ___________

(Short Answer)
4.7/5
(34)

If we use an out of range index with a vector, there will be an error message from the compiler.

(True/False)
4.8/5
(30)

The base type for a vector can be

(Multiple Choice)
4.9/5
(29)

When a vector is assigned to another vector

(Multiple Choice)
4.8/5
(45)

Which of the following returns the fourth character in the string variable named str and checks if there is a fourth character in the string?

(Multiple Choice)
4.8/5
(39)

All c-strings must be terminated by ________

(Short Answer)
4.8/5
(45)

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

(Multiple Choice)
4.9/5
(39)

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

(Short Answer)
4.9/5
(28)

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

(Multiple Choice)
4.9/5
(41)

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
(34)

Which string function returns the first occurrence of str1 in a string named str?

(Short Answer)
4.9/5
(37)

A string variable and a c-string are the same data type.

(True/False)
4.8/5
(33)

What is the proper way to declare a vector of strings named names?

(Multiple Choice)
4.8/5
(33)
Showing 41 - 60 of 69
close modal

Filters

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