这个警告是由于新版本的VC里time_t是64位的,而srand接受32位的unsigned int,所以会丢失数据。 改成srand((unsigned)time(NULL));强制转换time_t到unsigned int就可以了。