What happens when you attempt to compile and run the following code?#include <iostream>#include <algorithm>#include <map>using namespace std;int main() {int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 };map<int, int> m;for(int i=0; i < 10; i++) {m=t;}pair<const int,int> p(5,5);map<int, int>::iterator it = find(m.begin(), m.end(), p);if (it != m.end()){cout<<it?>first<<endl;}else{cout<<"Not found!\n";}return 0;}Program outputs:
A. 5
B. Not found!
C. 10
D. compilation error
What happens when you attempt to compile and run the following code?#include <iostream>#include <algorithm>#include <map
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What happens when you attempt to compile and run the following code?#include <iostream>#include <algorithm>#include <map
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!