Exam 8: Strings and Vectors

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

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

Free
(Short Answer)
4.7/5
(34)
Correct Answer:
Verified

strcmp or strncmp

The following code declares a vector of characters. vector characters<char>

Free
(True/False)
4.9/5
(40)
Correct Answer:
Verified

False

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

Free
(Multiple Choice)
4.8/5
(35)
Correct Answer:
Verified

B

The function used to 'put two c-strings together into one" is called

(Short Answer)
4.9/5
(29)

Which of the following would correctly read an entire line from an input file stream named fin into a string variable named line.

(Multiple Choice)
4.7/5
(31)

Which of the following declarations correctly creates a c-string that can hold the value "phonebook"

(Multiple Choice)
4.8/5
(37)

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

(True/False)
4.9/5
(37)

To change the size of a vector,one uses the ______________ member function.

(Short Answer)
4.7/5
(38)

Using the resize member function alone,you can increase the capacity of an STL vector.

(True/False)
4.8/5
(32)

Using the [i] on a string variable does not check for illegal values of i.

(True/False)
4.9/5
(46)

When the extraction operator is used to read data into a string,

(Multiple Choice)
4.8/5
(38)

What is the difference between strcmp and strncmp?

(Multiple Choice)
4.7/5
(39)

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

(True/False)
4.9/5
(37)

The ________ class lets you treat string values and variables like other pre-defined data types such as int).

(Short Answer)
4.8/5
(37)

A character array terminated with the null character is most correctly called

(Multiple Choice)
4.9/5
(37)

What is the name of the function to convert from a c-string that contains only digits to an integer?

(Short Answer)
4.9/5
(36)

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

(True/False)
4.8/5
(36)

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

What is wrong with the following code fragment? Char str1[10]="Mark",str2[15]="What's my name"; Strcpystr1,str2);

(Multiple Choice)
4.8/5
(41)

What is the c-string function to determine the number of characters in a c-string?

(Short Answer)
4.7/5
(32)
Showing 1 - 20 of 63
close modal

Filters

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