Exam 8: Strings and Vectors

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

To change the space already allocated for a vector,one uses the ______________ member function.

(Short Answer)
4.8/5
(29)

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

(Multiple Choice)
4.8/5
(41)

The base type for a vector can be

(Multiple Choice)
5.0/5
(41)

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

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

(Multiple Choice)
4.9/5
(36)

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

The following declares a c-string variable that will hold 10 letters. char str[10];

(True/False)
4.8/5
(33)

Using the == operator on a string variable results in the same value as using strcmp on two c-strings.

(True/False)
5.0/5
(35)

How do you call the function to read a whole line of inputup to 80 characters)from the keyboard into a c-string named str?

(Short Answer)
4.8/5
(42)

If v is a vector and i is an int variable,then in the following the value of i can be any nonnegative int value: v[i] = i;

(True/False)
4.9/5
(36)

Given the following declarations,which of the following is legal syntax? String str="Your name"; Char c_string[20]="My name";

(Multiple Choice)
4.8/5
(45)

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

(Short Answer)
4.7/5
(34)

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

(Multiple Choice)
4.8/5
(29)

The following code declares a vector of integers named numbers that reserves space for 100 integers. vector<int> numbers100);

(True/False)
4.8/5
(41)

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

(Multiple Choice)
4.9/5
(32)

____________ can be thought of as an array that can grow and shrink as needed.

(Short Answer)
4.8/5
(42)

The following declares a c-string and initializes it to "speaker" char str[]="speaker";

(True/False)
4.7/5
(40)

Vectors and arrays are the same data type.

(True/False)
4.8/5
(36)

In a vector,which of the following statements is true?

(Multiple Choice)
4.7/5
(30)

The c-string to number conversion functions are in the _________ library.

(Short Answer)
4.9/5
(36)
Showing 41 - 60 of 63
close modal

Filters

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