c Karte
#include <iostream>
#include <string>
#include <map>
using std::string;
using std::map;
map <int,string>MapName;//you can put type you want
map<int,string>::iterator iter;
int main(){
int i=31136;
string s="name;
//How you insert values
MapName.insert(pair<int,string>(i,s));
//How you print keys and values
for(iter=studentId.begin();iter!=studentId.end();iter++){
cout<<"Key"<<iter->first<<"Value: "<<iter->second<<endl;
}
//How you search data
if (m.find(31136) != m.end()) {
cout << "found" << endl;
}
else {
cout << "not found" << endl;
}
}
Dull Dolphin