References and argument passing
Initialization of objects and function calls
Pass by reference
When do we pass arguments by reference?
Guidance for passing arguments
Activity: Append an array's content to an std::vectorGraded Playground Autograder
In this problem, you will implement the function
AppendArrayToVector. This function will append the contents of an integer array to the back of an integer vector.
AppendArrayToVector's return type will be
void, and it will specify three parameters:
unsigned int, and
std::vector<int> respectively. Following the conventions outlined in the lessons, you must correctly determine how each argument should be passed to
AppendArrayToVector: by value, reference, or constant reference.
You will define
AppendArrayToVector such that each array element is appended to the back of the
std::vector<int>. You will append the elements residing in the array in ascending index order. You will begin at the array's index 0 and visit each element in order.