Jul 22, 2016 at 8:57pm
What output are you getting and what do you expect to get?
Jul 22, 2016 at 8:59pm
I don't get any output is the problem,just stays blank
I expected it to print name then adam
but I think Necip solved the problem I think I left them empty
Jul 22, 2016 at 9:01pm
I just changed the code to pretty much what Necips code did but it still prints blank it does not output anything :s
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#include <iostream>
#include <vector>
#include <map>
#include <string>
using namespace std;
int main()
{
map<string,string> name;
map<string,string>::iterator mitr = name.begin();
name["adam"] = "adam";
name["mike"] = "mike";
for(mitr;mitr!=name.end();mitr++){
cout << mitr->first << endl;
cout << mitr->second << endl;
}
}
|
Last edited on Jul 22, 2016 at 9:03pm