Hello,
I want to use a pair from STL as a key of a map.
#include <iostream>
#include <map>
using namespace std;
int main() {
typedef pair<char*, int> Key;
typedef map< Key , char*> Mapa;
Key p1 ("Apple", 45);
Key p2 ("Berry", 20);
Mapa mapa;
mapa.insert(p1, "Manzana");
mapa.insert(p2, "Arandano");
return 0;
}
But the compiler throw a bunch of unreadable information and I'm very new to C and C++.
How can I use a pair as a key in a map? And in general How can I use any kind of structure (objects, structs, etc) as a key in a map?
Thanks!