You are viewing a single comment's thread. Return to all comments →
using map in c++
map <int, string> m = {{1, "one"}, {2, "two"}, {3, "three"}, {4, "four"}, {5, "five"}, {6, "six"}, {7, "seven"}, {8, "eight"}, {9, "nine"}, }; // creating iterator map < int, string> :: iterator itr; itr = m.find(n); if(itr != m.end()){ cout << itr -> second; } else { cout << "Greater than 9";}
Conditional Statements
You are viewing a single comment's thread. Return to all comments →
using map in c++