How would I implement a map with more than 1 key, for example, to retrieve a customer's name based on their address, using the house number as 1 key and the street name as another. (the 2 keys put together should be unique) ??
thanks
How would I implement a map with more than 1 key, for example, to retrieve a customer's name based on their address, using the house number as 1 key and the street name as another. (the 2 keys put together should be unique) ??
thanks
Use a struct to contain the data for the key:
DavidCode:typedef struct { unsigned int uiHouseNumber; char pcStreetName[255]; } Address; typedef map<Address, string, less<Address>, allocator> Customer;
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them
In the Land of Mordor where the Shadows lie.