私のコンパイラ: Dev C++ 5.3.0.3 TDM-GCC 4.6.1 64 ビット 私の OS: Windows 7、64 ビット
私のCコード:
# include "stdio.h"
# include "string.h"
# define MAX (501)
int main() {
char
text[MAX]="";
int i;
i=0;
printf("%d\n",strlen(text)); /* 0 */
printf("%d\n",(strlen(text)-1)); /* -1 */
if ( i<= (strlen(text)-1) ) printf("haha"); /* haha */
return 0;
}
私の質問:なぜ「はは」が印刷されているのですか?! ( 0>-1 ?!!!) ご協力ありがとうございます!