Question
myList.copyEven(myVector, yourList); The statement above is a call to the function copyEven, a member function of the class AnyList, where: myList is an object of
myList.copyEven(myVector, yourList);
The statement above is a call to the function copyEven, a member function of the class AnyList, where:
myList is an object of the class AnyList
myVector is a vector of integers
yourList is an object of the class AnyList
function copy copies all the even elements stored in the vector into the calling object, and then copies all of the elements stored in the calling object into the AnyList parameter object.
It is irrelevant whether any of the object have elements or not.
Example:
Calling object is empty.
Vector parameter is: 1 2 3 4
AnyList object parameter is empty.
Function runs...
Calling object is: 2 4
Vector parameter is: 1 2 3 4
AnyList object parameter is: 2 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started