Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void mapDisplay(map<int, Inventory> *mapn)
- {
- //Following your example...
- map<int, Inventory>::const_iterator mapIter;
- mapIter = mapn->begin();
- cout << "Inventory map contents as follows: " << "\n";
- for (unsigned int i = 0; i < mapn->size(); i++)
- {
- cout << "At key " << mapIter->first << ": " << "\n";
- cout << &mapn[mapIter->first].toString() << "\n";
- mapIter++;
- }
- //Throws error C2039: 'toString': is not a member of 'std::map<int,Inventory,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>
- //Trying some alternatives, but if you could leave feedback as to why this does not work I would find it helpful. I've scratched my head for a couple hours now on it.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement