Q: 9
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;
}
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.