Map a nice container of C++. I love it. But this afternoon, after debugged four hours, I found that there was a bug in my mind about using map.
There was a sample code:
------------------------------------
#include  <map>
#include <string>
using namespace std;
int main()
{
	map
 mapTest;
	mapTest["Good"] = 2;
	mapTest["Morning"] = 3;
	mapTest["To"] = 4;
	mapTest["You"] = 5;
	return 1;
}
------------------------------------
In the above program, before returning, the map content is:
=======Content of mapTest=======
Good    2
Morning 3
To      4
You     5
Then I used a search on this map by "YYThanks" as index, as following:
------------------------------------
#include
没有评论:
发表评论