Exam 9: Pointers

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

Not all arithmetic operations can be performed on pointers. For example, you cannot __________ or __________ pointers.

(Multiple Choice)
4.9/5
(25)

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

(Multiple Choice)
4.8/5
(35)

In C++11 you can use smart pointers to dynamically allocate memory and not worry about deleting the memory when you are finished using it.

(True/False)
4.8/5
(37)

When you work with a dereferenced pointer, you are actually working with

(Multiple Choice)
4.9/5
(29)

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

(Multiple Choice)
4.8/5
(35)

To help prevent memory leaks from occurring in C++11, a __________ automatically deletes a chunk of dynamically allocated memory when the memory is no longer being used.

(Multiple Choice)
4.9/5
(26)

The weak_ptr can share ownership of a piece of dynamically allocated memory.

(True/False)
4.8/5
(37)

With pointer variables you can __________ manipulate data stored in other variables.

(Multiple Choice)
4.9/5
(31)

The following statement __________ cin >> *num3;

(Multiple Choice)
4.8/5
(26)

Which of the following statements deletes memory that has been dynamically allocated for an array?

(Multiple Choice)
4.8/5
(32)

What will the following code output? Int *numbers = new int[5]; For (int i = 0; i <= 4; i++) *(numbers + i) = i; Cout << numbers[2] << endl;

(Multiple Choice)
4.7/5
(33)

The __________ and __________ operators can be used to increment or decrement a pointer variable.

(Multiple Choice)
4.8/5
(35)

The unique_ptr is the sole owner of a piece of dynamically allocated memory.

(True/False)
4.7/5
(34)

To use any of the smart pointers in C++11 you must use the following directive in the header file: #include <memory>

(True/False)
4.8/5
(37)

A pointer variable is designed to store

(Multiple Choice)
4.9/5
(42)

An array name is a pointer constant because the address stored in it cannot be changed at runtime.

(True/False)
4.9/5
(32)

It is legal to subtract a pointer variable from another pointer variable.

(True/False)
4.9/5
(36)

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

(Multiple Choice)
4.9/5
(36)

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

(Multiple Choice)
4.9/5
(32)

Select all that apply. Which of the following can be used as pointers?

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

Filters

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