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

来自http://tunps.com/warning-c4018

一般是int和unsigned比较的时候报错。转为一致的数据类型即可。

比如

int sent = 0;
while (sent<strlen(query)) 
{
    //....
}
strlen的返回值是size_t,也就是unsigned。而sent为int。将sent改为unsigned

About tunpishuang

just 4 fun·····
This entry was posted in 未分类 and tagged . Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>