Exam 9: Pointers and Dynamic Arrays

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Dynamic variables are created at __________

(Short Answer)
4.9/5
(28)

Which of the following correctly declare 3 integer pointers?

(Multiple Choice)
4.8/5
(37)

Which of the following statements correctly returns the memory from the dynamic array pointer to by p1 to the freestore?

(Multiple Choice)
4.8/5
(34)

If p1 is an integer pointer variable, with the value of 1000, p1++ changes P1 to point to the memory location 1001.

(True/False)
4.7/5
(36)

A ___________ is the memory address of a variable.

(Short Answer)
4.9/5
(37)

Write the code that assigns to p1 an integer pointer variable) the pointer to a dynamically created integer.

(Short Answer)
4.9/5
(40)

You can assign an array to a pointer variable.

(True/False)
4.9/5
(42)

A pointer can be stored in an integer variable.

(True/False)
4.9/5
(29)

If p1 and p2 are both pointers that point to integers in memory, the condition p1==p2 will be true if the values that are in those memory locations are the same.

(True/False)
4.9/5
(42)

In the statement cout << *p1;, the * is called the ________________

(Short Answer)
4.8/5
(30)

Given that p1 is a pointer, p1++

(Multiple Choice)
4.7/5
(35)

Given that p1 is an integer pointer variable, and a1 is an integer array, which of the following statements are not legal code?

(Multiple Choice)
4.8/5
(32)

The & operator is called the _______________

(Short Answer)
4.8/5
(41)

What is wrong with the following code fragment? Int *p1, *p2; P1 = new int; P2 = new int; *p1=11; *p2=0; P2=p1; Cout << *p1 <<" " << *p2 << endl; Delete p1; Delete p2;

(Multiple Choice)
4.7/5
(31)

What is the output of the following code fragment? Int v1=2, v2=-1, *p1, *p2; P1 = & v1; P2= & v2; P2=p1; Cout << *p2 << endl;

(Multiple Choice)
4.9/5
(37)

int *p1; declares a static variable.

(True/False)
4.8/5
(44)

Dynamic variables are created from the ___________.

(Short Answer)
4.9/5
(37)

If two pointer variables point to the same memory location, what happens when one of the pointers is freed?

(Multiple Choice)
4.9/5
(30)

Which of the following correctly declares a dynamic array of strings?

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

Filters

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