Create an array of 5 integers.
int array[5];
The value a pointer holds.
What is an address?
What is a pointer?
Needed to use vectors in your program.
What is the vector header file?
Type of function that does not return a value.
What is a void function?
How an array is passed to a function.
What is by reference?
Declare a pointer to a string.
string * ptr = nullptr;
Keyword used to create dynamic memory.
What is new?
Used to find how many elements are in a vector.
What is vector.size()?
A function prototype is NOT declared here.
What is main?
The data type of an array variable.
All pointers should be deleted when not in use. (true/false)
What is false?
Function that releases memory to be freely used again.
What is the delete function?
Declare a vector that holds vectors of integers named vectorVect. (if this is not possible, say not possible)
Function definitions can access variables in your main function by default. (true/false)
What is false?
Needed to swap array rows.
What is a temporary variable?
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?
Not needed when creating an array dynamically.
What is the size?
How can you assign a pointer to the beginning of a vector that holds integers?
vector<int>* ptr = &vector[0];
If your function returns a value, what do you need in your main code?
What is a variable to receive the value?
How would you traverse a 2D array using a pointer, twoPtr?
Explain your code.
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]?
Code.
A vector named vectorX has 3 pointers to 3 different 1D arrays. Can you assign vectorX[0] to vectorX[3]?
What is yes?
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.