warning C4018: “<”: 有符号/无符号不匹配


出错代码      for(int j=0;j<detector.size();j++)

出错原因分析:

 detector 是一个Vector容器 ,detecot.size() 在容器说明中 被定义为: unsigned int 类型, 而j是int 类型 所以会出现: 有符号/无符号不匹配  警告


错误改正 : 定义j为unsigned 类型后就可以了

即: for(unsigned int j=0;j<detector.size();j++)








Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐