Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying contents of a <map> containing classes

Status
Not open for further replies.

ARCITS

Programmer
Apr 4, 2002
99
GB
I have a map with a left hand string arguement and a right hand class pointer.

When displaying the map how do I display the class objects instead of their memory location which is held?

Any help appreciated.


Thanks.



map <string,titles*> TitlesMap;
map <string,titles*>::iterator it;

// ===== display titles =====
titles::display()
{
// display header information
cout << &quot;Library Information System&quot; << &quot;\n&quot;;
cout << &quot;==========================&quot; << &quot;\n&quot;;

// list all titles
for (it=TitlesMap.begin();it != TitlesMap.end();++it)
{
cout << &quot;Key = &quot; << (*it).first;
cout << &quot;Value = &quot; << (*it) << endl; ?????????????
}
}



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top