Exam 8: Strings and Vectors
Exam 1: Introduction to Computer and C++ Programming56 Questions
Exam 2: C++ Basics57 Questions
Exam 3: More Flow of Control45 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value53 Questions
Exam 5: Functions for All Sub Tasks54 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes52 Questions
Exam 7: Arrays48 Questions
Exam 8: Strings and Vectors69 Questions
Exam 9: Pointers and Dynamic Arrays39 Questions
Exam 10: Defining Classes61 Questions
Exam 11: Friends, Overloaded Operators, and Arrays in Classes56 Questions
Exam 12: Separate Compilation and Namespaces41 Questions
Exam 13: Pointers and Linked Lists64 Questions
Exam 14: Recursion48 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates35 Questions
Exam 18: Standard Template Library59 Questions
Select questions type
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)
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)
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)
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)
What is the proper way to declare a vector of strings named names?
(Multiple Choice)
4.8/5
(33)
Showing 41 - 60 of 69
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)