Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

swimlikehell

macrumors member
Original poster
Aug 31, 2006
46
0
I m trying to insert into a map set up like <string, uint16> if anyone could let me know what i need to do to put information into this it would be much appreciated. thanks
 

SamMiller0

macrumors member
Aug 17, 2004
66
0
San Jose, CA
The easiest method is probably:

Code:
typedef std::map<std::string, uint16_t> HashTable;
HashTable foo;
foo.insert(HashTable::value_type("hello world", 42));
 

iSee

macrumors 68040
Oct 25, 2004
3,540
272
easiest method:
Code:
	std::map<std::string, uint16_t> myMap;
	myMap["the key"] = 77;
just accessing the map with the square bracket operator will insert a value
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.