Exam 12: More on C-Strings and the String Class
Exam 1: Introduction to Computers and Programming40 Questions
Exam 2: Introduction to C++40 Questions
Exam 3: Expressions and Interactivity40 Questions
Exam 4: Making Decisions37 Questions
Exam 5: Looping38 Questions
Exam 6: Functions40 Questions
Exam 7: Introduction to Classes and Objects40 Questions
Exam 8: Arrays37 Questions
Exam 9: Searching, Sorting, and Algorithm Analysis36 Questions
Exam 10: Pointers50 Questions
Exam 11: More About Classes and Object-Oriented Programming64 Questions
Exam 12: More on C-Strings and the String Class38 Questions
Exam 13: Advanced File and Io Operations38 Questions
Exam 14: Recursion20 Questions
Exam 15: Polymorphism and Virtual Functions20 Questions
Exam 16: Exceptions, Templates, and the Standard Template Library STL40 Questions
Exam 17: Linked Lists38 Questions
Exam 18: Stacks and Queues36 Questions
Exam 19: Binary Trees37 Questions
Select questions type
Although C++ provides ample library functions to handle numeric values, we must write all of our own functions to manipulate character values.
Free
(True/False)
4.9/5
(37)
Correct Answer:
False
To access the last character of a string class object str you can use the expression
Free
(Multiple Choice)
4.8/5
(34)
Correct Answer:
D
To declare a C- string, you should use the type expression string *.
Free
(True/False)
4.7/5
(40)
Correct Answer:
False
The function accepts a C- string as an argument and returns the length of the string (not including the null terminator).
(Multiple Choice)
4.9/5
(41)
To declare an array that will store students' last names of up to 25 characters in length, which is an appropriate statement?
(Multiple Choice)
4.8/5
(43)
A good way to convert a string such a "572" to an equivalent integer such as 572
(Multiple Choice)
4.7/5
(45)
The function concatenates the contents of one C- string with another C- string.
(Multiple Choice)
4.8/5
(35)
The string class member function returns the C- string value of the string object.
(Multiple Choice)
4.7/5
(40)
The library function reverses the order of a character array.
(Multiple Choice)
4.8/5
(32)
The proper expression to compare the first characters of two string objects str1 and str2 is
(Multiple Choice)
4.8/5
(36)
A C- string can be assigned to an variable whose type is the string class.
(True/False)
5.0/5
(31)
By being able to pass arrays as arguments, you can write your own functions for processing C- strings.
(True/False)
4.8/5
(28)
A C- string is a sequence of characters stored in consecutive memory, terminated by a
(Multiple Choice)
4.7/5
(37)
To use the ostringstream class, you must include the memstringstream header file.
(True/False)
4.9/5
(40)
A library function that looks for the occurrence of one string inside another is
(Multiple Choice)
4.8/5
(46)
It is possible to implement a string class by using a dynamically allocated array of characters.
(True/False)
4.8/5
(32)
When using the strcatfunction, you must be careful not to overflow the bounds of the array allocated for the target string.
(True/False)
4.8/5
(33)
Assume that str1 and str2 are variables of type C- string. The proper expression to use when comparing them for equality is
(Multiple Choice)
4.9/5
(40)
Showing 1 - 20 of 38
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)