Score: 0/70%
Question 1:

A pointer variable can store ________.

Question 2:

In order to determine the address of a variable in C++, we can use the ________ operator.

Question 3:

Pointer variables must always be ________ before they are used.

Question 4:

In order to follow a pointer and access the data that it is pointing to, we must ________ the pointer using the ________ operator.

Question 5:

Pointers can be used to dynamically allocate storage from the ________ at ________.

Question 6:

When using raw pointers and dynamic storage allocation, we must always de-allocate the used storage by using ________ to prevent ________.

Question 7:

________ and pointers can be used interchangeably in many contexts.

Question 8:

What types of variables can ptr store given the following declaration below?

int **ptr; 

Question 9:

What does the following code snippet display?

int *data = new int[5];

for (int i = 0; i<5; i++)
   *(data + i) = i*2;

for (int i = 0; i<=4; i++)
   cout << data[i] << " " ;
cout << endl;   
 
delete [] data;
Question 10:

Given the following pointer declarations, what can you say about ptr1 and ptr2?

int *ptr1;
int *ptr2 { nullptr};