关于关联容器map的疑惑??大家帮帮忙.谢谢.
include<map>
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main()
{
map<string,string> transMap;
typedef map<string,string>::value_type valType;
transMap.insert ( valType ( "gratz", "grateful" ));
transMap.insert ( valType ( "'em", "them" ));
transMap.insert ( valType ( "cuz", "because" ));
transMap.insert ( valType ( "nah", "no" ));
transMap.insert ( valType ( "sez", "says" ));
transMap.insert ( valType ( "tanx","thanks" ));
transMap.insert ( valType ( "wuz", "was" ));
transMap.insert ( valType ( "pos", "suppose" ));
map<string,string>::iterator its = transMap.begin ();
map<string,string>::iterator itsEnd = transMap.end ();
cout << "This is my secret transform" <<endl;
while ( its != itsEnd)
{
cout << "Key: " << (*its).first <<"\t";
cout << "Value: " << (*its).second <<endl;
its ++;
}
cout << endl;
cout << endl;
return 0
}
这是程序的一段.为什么输出的key 和value 是从 "them"到"was"??
而第一个和最后一个都没有输出???
还有是这段程序在vc6.0编译时有百个警告,怎么避免???
help me!!谢谢.