Exam 10: Characters, C++-Strings, and More About the String Class

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

Look at the following statement: sum += *array++; This statement...

(Multiple Choice)
4.8/5
(34)

When the less than ( < ) operator is used between two pointer variables, the expression is testing whether

(Multiple Choice)
4.9/5
(34)

What does the following statement do? double *num2;

(Multiple Choice)
4.9/5
(28)

A pointer variable may be initialized with

(Multiple Choice)
4.9/5
(39)

Look at the following code. int numbers[] = {0, 1, 2, 3, 4 }; Int *ptr = numbers; Ptr++; After this code executes, which of the following statements is true?

(Multiple Choice)
4.8/5
(42)

What will the following code output? int number = 22; Int *var = &number; Cout << *var << endl;

(Multiple Choice)
4.8/5
(37)

If a variable uses more than one byte of memory, for pointer purposes its address is:

(Multiple Choice)
4.8/5
(35)

Dynamic memory allocation occurs

(Multiple Choice)
4.8/5
(35)

Assuming myValues is an array of int values, and index is an int variable, both of the following statements do the same thing. cout << myValues[index] << endl; cout << *(myValues + index) << endl;

(True/False)
4.9/5
(21)

The ampersand (&) is used to dereference a pointer variable in C++.

(True/False)
4.7/5
(37)

The _________ , also known as the address operator, returns the memory address of a variable.

(Multiple Choice)
4.9/5
(39)

The statement cin >> *num3;

(Multiple Choice)
4.8/5
(37)

Not all arithmetic operations may be performed on pointers. For example, you cannot ________ or __________ a pointer.

(Multiple Choice)
4.8/5
(42)

A pointer variable is designed to store

(Multiple Choice)
4.8/5
(45)

Assuming ptr is a pointer variable, what will the following statement output? cout << *ptr;

(Multiple Choice)
4.8/5
(33)

C++ does not perform array bounds checking, making it possible for you to assign a pointer the address of an element out of the boundaries of an array.

(True/False)
4.9/5
(36)

These can be used as pointers.

(Multiple Choice)
4.8/5
(37)

When you pass a pointer as an argument to a function, you must

(Multiple Choice)
4.9/5
(43)

When using the new operator with an older compiler, it is good practice to:

(Multiple Choice)
4.7/5
(35)

A function may return a pointer, but the programmer must ensure that the pointer

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

Filters

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