boost - How do you create a hash table in C++? -


i creating simple hash table in vs 2008 c++.

#include <map> std::map <string, char> grade_list; grade_list["john"] = 'b'; 

i getting error: error c2057: expected constant expression

what mean? boost library have better?

thanks!

#include <map> #include <iostream> #include <string>  int main() {     std::map<std::string, char> grade_list;     grade_list["john"] = 'b';     std::cout << grade_list["john"] << std::endl;     return 0; } 

this works great g++. should specify std:: before string in map declaration, did in code.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -