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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where are std::map Functions

Status
Not open for further replies.

moetman

Programmer
Nov 18, 2004
4
0
0
AU
I'm have a problem using C++ std Lib map iterators in VisualSudio 2003. I can't seem to get some map member functions like begin() , end() etc ... I'm
#including <map> . I've noticed in the documentation that there is reference to map members and <map> members (which seems to be the one I'm using). So how do I specify the library I want ?
 
depending of what you want to do,you could try something like:

Code:
#include <map>
#include <string>
using std::map;
....
....
map< string, int > myMap;
//now,you can do what ever operation you want with "myMap"
// here is an example:
myMap["Mercury"] = 1;
myMap["Venus"] = 2;
myMap["Earth"] = 3;
....
...
int map_size = myMap.size();
....
//anyway,i think you got the point

 
oops,sorry i didn't read your post completely,i have miss the part with "VisualSudio 2003",but anyway i have compiled the code sample with "Visual Studion 2005 Beta"
and it works,which means that you shouldn't have any problem for using the "map" functions in "VisualStudio 2003",anyway that's what i think.
 
It turned out I made a really stupid mistake .. Many Thanks for your help anyway :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top