What will happen when you attempt to compile and run the following code?#include <iostream>#include <map>#include <vector>#include <sstream>#include <string>using namespace std;int main() {int t[] = { 3, 4, 2, 1, 0, 3, 4, 1, 2, 0 };vector<int> v(t, t + 10);multimap<int, string> m;for (vector<int>::iterator i = v.begin(); i != v.end(); i++) { stringstream s;s << *i << *i; m.insert(pair<int, string>(*i, s.str()));}pair<multimap<int, string>::iterator, multimap<int, string>::iterator> range; range = m.equal_range(2); for (multimap<int, string>::iterator i = range.first; i != range.second; i++) { cout << i?>first << " ";}return 0;}The output will be:
A. 2 2
B. 1 2
C. 1 3
D. 2 E. 0 2
What will happen when you attempt to compile and run the following code?#include <iostream>#include <map>#include <vecto
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What will happen when you attempt to compile and run the following code?#include <iostream>#include <map>#include <vecto
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!