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

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

The expression str1 < str 2 is true when

(Multiple Choice)
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.9/5
(36)

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

The code int x = 0; while (s[x] != 0){ x++;}

(Multiple Choice)
4.9/5
(44)

An array of characters ending with the null terminator is called

(Multiple Choice)
4.8/5
(36)

The following statement declares a string object and initializes it to "Once upon a time". string theString("Once upon a time");

(True/False)
4.8/5
(36)

The function _ _ accepts pointers to two strings and an integer argument, which indicates how many characters to copy from the second string to the first.

(Multiple Choice)
5.0/5
(50)

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

(True/False)
4.8/5
(39)

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

(Multiple Choice)
4.7/5
(37)

The itoa function is similar to atoi, but it works in reverse.

(True/False)
4.9/5
(38)

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

(Multiple Choice)
4.8/5
(33)

A good way to convert a value of type double to a string is

(Multiple Choice)
4.8/5
(41)

The null terminator stands for the ASCII code

(Multiple Choice)
4.9/5
(43)

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

(Multiple Choice)
4.7/5
(46)

The string class member function will return the number of characters in the string object.

(Multiple Choice)
4.7/5
(31)

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.8/5
(40)

The C++ compiler performs strict array bounds checking whenever an array of characters is being accessed.

(True/False)
4.9/5
(36)

The expression strcmp("ab", "cde") returns

(Multiple Choice)
4.9/5
(39)
Showing 21 - 38 of 38
close modal

Filters

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