What happens when you attempt to compile and run the following code?
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
int main() {
int t[] = {1,2,3,2,3,5,1,2,7,3,2,1,10, 4,4,5};
vector<int> v1(t, t + 15);
set<int> s1(t, t + 15);
pair<set<int>::iterator, vector<int>::iterator > resultSet = mismatch(s1.begin(), s1.end(), v1.begin());
cout<<*resultSet.first<<" "<<*resultSet.second<<endl;
return 0;
}
Program outputs:
- 2 4
- 4 2
- 0 5
- compilation error
Reveal Solution
Next Question