1.A call to function f() assigns the return vector to resultV. List the contents
ID: 3638721 • Letter: 1
Question
1.A call to function f() assigns the return vector to resultV. List the contents of resultVtemplate <typename T>
vector<T> f(const vector<T>& x, const vector<T>& y)
{ vector<T> v = x;
int i;
for (i=0;i < y.size();i++)
v.push_back(y[i]);
return v;
}
int a[] = {4, 7, 5, 2, 3}, b[] = {15, 18, 25};
int aSize = 5, bSize = 3;
vector<int> va(a, a+aSize), vb(b, b+bSize), resultV;
resultV = f(va, vb);
cout << endl << "done" << endl;
resultV =
Explanation / Answer
resultV = {4, 7, 5, 2, 3,15, 18, 25};
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.