가능한 중복은 :
Unsigned and signed comparison
A riddle (in C)비교 연산
#include<stdio.h>
#define TOTAL_ELEMENTS (sizeof(array)/sizeof(array[0]))
int array[] = {23,34,12,17,204,99,16};
int main()
{
int d = -1;
if (d < TOTAL_ELEMENTS)
printf("of course -1 is less than %d",TOTAL_ELEMENTS);
else
printf("how on earth");
return 0;
}
대답은 위의 프로그램의 출력은 :::입니다 : 도대체 어떻게
에
무엇이 당신의 질문입니까?! –
참고 사항 : http://stackoverflow.com/questions/950051/confused-about-c-macro-expansion-and-integer- arithmetic – Mat