char* s =(char*) "sss"; int j = -1; printf("%d", j < strlen(s));
j < 3主要是关于和之间的区别j < strlen(s)。
j < 3
j < strlen(s)
在上面的代码中,printf()函数打印0,但是如果我改为strlen(s)3,结果就变成1(正如我所期望的那样)。
printf()
strlen(s)
原因是什么?
c integer strlen comparison-operators implicit-conversion
c ×1
comparison-operators ×1
implicit-conversion ×1
integer ×1
strlen ×1