Arrays
Pointers
Dynamic Memory
Vectors
Functions
100

Create an array of 5 integers.

int array[5];

100

The value a pointer holds.

What is an address?

100
Type of variable needed to create memory dynamically.

What is a pointer?

100

Needed to use vectors in your program.

What is the vector header file?

100

Type of function that does not return a value.

What is a void function?

200

How an array is passed to a function.

What is by reference?

200

Declare a pointer to a string.

string * ptr = nullptr;

200

Keyword used to create dynamic memory.

What is new?

200

Used to find how many elements are in a vector.

What is vector.size()?

200

A function prototype is NOT declared here.

What is main?

300

The data type of an array variable.

What is a constant pointer?
300

All pointers should be deleted when not in use. (true/false)

What is false?

300

Function that releases memory to be freely used again.

What is the delete function?

300

Declare a vector that holds vectors of integers named vectorVect. (if this is not possible, say not possible)

vector<vector<int>> vectorVect;
300

Function definitions can access variables in your main function by default. (true/false)

What is false?

400

Needed to swap array rows.

What is a temporary variable?

400

Suppose you have two pointers to integers, iPtr and iPtr2. iPtr points to &array[0] and iPtr points to &array[7]. What does iPtr - iPtr2 equal?

What is 7?

400

Not needed when creating an array dynamically.

What is the size?

400

How can you assign a pointer to the beginning of a vector that holds integers?

vector<int>* ptr = &vector[0];

400

If your function returns a value, what do you need in your main code?

What is a variable to receive the value?

500

How would you traverse a 2D array using a pointer, twoPtr?

Explain your code.

500

You have a 2D array, twoArr[5][5], and your pointer iPtr points to twoArr[3][4]. If iPtr++, what is the pointer pointing to?

What is twoArr[4][0]?

500
How would you create a dynamic 2D array?

Code.

500

A vector named vectorX has 3 pointers to 3 different 1D arrays. Can you assign vectorX[0] to vectorX[3]?

What is yes?

500

Write a function, copyArray, that receives an array and its size, and returns a pointer to an array that is a copy of the received array.

Code.