Exam 12: More on C-Strings and the String Class

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

It is possible to implement a string class by using a dynamically allocated array of characters.

(True/False)
4.9/5
(29)

If str is a string class object, the member function str.length() returns

(Multiple Choice)
4.9/5
(31)

The ________ library function reverses the order of a character array.

(Multiple Choice)
4.8/5
(38)

An array of characters ending with the null terminator is called

(Multiple Choice)
4.9/5
(31)

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.9/5
(38)

When using the strcat function, you must be careful not to overflow the bounds of the array allocated for the target string.

(True/False)
4.9/5
(28)

To use the ostringstream class, you must include the memstringstream header file.

(True/False)
4.9/5
(46)

The ________ function converts an integer to a string and returns the string value.

(Multiple Choice)
4.9/5
(39)

There exist C++ stream classes that write and read in-memory strings.

(True/False)
4.8/5
(39)

The null terminator stands for the ASCII code

(Multiple Choice)
4.9/5
(23)

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

The ________ function concatenates the contents of one C-string with another C-string.

(Multiple Choice)
4.9/5
(39)

The type of the literal string "Hello" is best described as

(Multiple Choice)
4.9/5
(44)

After num = stoi("1000"); executes, what value is stored in the variable num?

(Multiple Choice)
4.8/5
(33)

A C-string can be assigned to a variable whose type is the string class.

(True/False)
4.7/5
(35)

To access the last character of a string class object str you can use the expression

(Multiple Choice)
4.8/5
(36)

To use the strlen function in a program, you must #include

(Multiple Choice)
4.7/5
(31)

A library function that looks for the occurrence of one string inside another is

(Multiple Choice)
4.7/5
(33)

A C-string is a sequence of characters stored in consecutive memory, terminated by a

(Multiple Choice)
4.7/5
(39)

A good way to convert a string such a "572" to an equivalent integer such as 572

(Multiple Choice)
4.9/5
(35)
Showing 21 - 40 of 40
close modal

Filters

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