Exam 12: More on C-Strings and the String Class
Exam 1: Introduction to Computers and Programming40 Questions
Exam 2: Introduction to C Plus Plus40 Questions
Exam 3: Expressions and Interactivity40 Questions
Exam 4: Making Decisions40 Questions
Exam 5: Looping40 Questions
Exam 6: Functions40 Questions
Exam 7: Introduction to Classes and Objects40 Questions
Exam 8: Arrays40 Questions
Exam 9: Searching, Sorting, Algorithm Analysis40 Questions
Exam 10: Pointers62 Questions
Exam 11: More About Classes and Object-Oriented Programming70 Questions
Exam 12: More on C-Strings and the String Class40 Questions
Exam 13: Advanced File and Io Operations40 Questions
Exam 14: Recursion20 Questions
Exam 15: Polymorphism and Virtual Functions22 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 Trees38 Questions
Select questions type
To declare a C-string, you should use the type expression string *.
Free
(True/False)
4.9/5
(39)
Correct Answer:
False
The following statement declares a string object and initializes it to "Once upon a time".
string theString("Once upon a time");
Free
(True/False)
4.8/5
(33)
Correct Answer:
True
The proper expression to compare the first characters of two string objects str1 and str2 is
Free
(Multiple Choice)
4.8/5
(33)
Correct Answer:
B
Which statements convert the string "10" to the integer value 10?
(Multiple Choice)
4.9/5
(32)
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.8/5
(34)
The string class append member function str.append(s)tacks a string s to the end of str.
(True/False)
4.8/5
(33)
To account for the null terminator stored at the end of each C-string, the strlen function returns the number of characters in its argument, plus one.
(True/False)
4.9/5
(37)
Although C++ provides ample library functions to handle numeric values, we must write all of our own functions to manipulate character values.
(True/False)
4.8/5
(38)
The >> operator can be used to convert a value of type double to an equivalent string object stored in memory.
(True/False)
4.8/5
(41)
By being able to pass arrays as arguments, you can write your own functions for processing C-strings.
(True/False)
4.9/5
(39)
The C++ compiler performs strict array bounds checking whenever an array of characters is being accessed.
(True/False)
4.7/5
(30)
The string class member function ________ will return the number of characters in the string object.
(Multiple Choice)
4.8/5
(32)
The string class member function ________ returns the C-string value of the string object.
(Multiple Choice)
4.8/5
(35)
Assume that str1 and str2 are objects of the string class. The proper expression to use when comparing them for equality is
(Multiple Choice)
4.8/5
(32)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)