Exam 8: Strings and Vectors
Exam 1: Introduction to Computer and C Programming55 Questions
Exam 2: C++ Basics54 Questions
Exam 3: More Flow of Control44 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value51 Questions
Exam 5: Functions for All Sub Tasks53 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes51 Questions
Exam 7: Arrays34 Questions
Exam 8: Strings and Vectors63 Questions
Exam 9: Pointers and Dynamic Arrays40 Questions
Exam 10: Defining Classes50 Questions
Exam 11: Friends, overloaded Operators, and Arrays in Classes49 Questions
Exam 12: Separate Compilation and Namespaces38 Questions
Exam 13: Pointers and Linked Lists51 Questions
Exam 14: Recursion43 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates33 Questions
Exam 18: Standard Template Library57 Questions
Select questions type
To compare two c-strings you use the __________ function.
Free
(Short Answer)
4.7/5
(34)
Correct Answer:
strcmp or strncmp
The following code declares a vector of characters.
vector characters<char>
Free
(True/False)
4.9/5
(40)
Correct Answer:
False
To declare a c-string and initialize it to the value of "phonebook",
Free
(Multiple Choice)
4.8/5
(35)
Correct Answer:
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)
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)