CPP practice question 23 of 30

What happens when you attempt to compile and run the following code? #include #include #include using namespace std; bool compare(int a, int b) {…

Choose your answer, then check it against the explanation.

What happens when you attempt to compile and run the following code? #include #include #include using namespace std; bool compare(int a, int b) { return a == b; } int main () { int t[] = {1,2,3,4,5,1,2,3,4,5}; vector v (t,t+10); vector::iterator it = v.begin(); int m1[] = {1, 2, 3}; while ( (it = find_first_of (it, v.end(), m1, m1+3)) != v.end()) { cout<<it?v.begin()<<" "; } cout<< endl; return 0; }
Answer options
Question 23 of 30

Keep practicing

Take the free CPP practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other CPP practice questions

Scroll to Top