Exam 9: Pointers

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

Which of the following statements is not valid C++ code?

Free
(Multiple Choice)
4.8/5
(34)
Correct Answer:
Verified

E

A pointer can be used as a function argument, giving the function access to the original argument.

Free
(True/False)
4.8/5
(33)
Correct Answer:
Verified

True

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

Free
(Multiple Choice)
4.8/5
(29)
Correct Answer:
Verified

C

Use the delete operator only on pointers that were

(Multiple Choice)
4.9/5
(33)

What will the following statement output? Cout << &num1;

(Multiple Choice)
5.0/5
(41)

In C++11, the __________ keyword was introduced to represent address 0.

(Multiple Choice)
5.0/5
(36)

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

(True/False)
4.8/5
(32)

Every byte in the computer's memory is assigned a unique

(Multiple Choice)
4.9/5
(31)

In the following statement, what does int mean? Int *ptr = nullptr;

(Multiple Choice)
4.9/5
(37)

Select all that apply. Select as many of the following options that make this sentence true: The contents of pointer variables may be changed with mathematical statements that perform

(Multiple Choice)
4.9/5
(38)

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

(Multiple Choice)
4.9/5
(39)

Which of the following defines a unique_ptr named uniq that points to a dynamically allocated int?

(Multiple Choice)
4.9/5
(38)

With pointer variables you can access but not modify data in other variables.

(True/False)
5.0/5
(36)

Dynamic memory allocation occurs

(Multiple Choice)
4.8/5
(29)

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

(Multiple Choice)
4.8/5
(26)

Select all that apply. Of the following, which statements have the same meaning?

(Multiple Choice)
4.9/5
(30)

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

(Multiple Choice)
4.9/5
(40)

In C++11, the nullptr keyword was introduced to represent the address 0.

(True/False)
4.8/5
(41)

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)

The following statement __________ int *ptr = new int;

(Multiple Choice)
4.8/5
(25)
Showing 1 - 20 of 47
close modal

Filters

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