[root@bjxdurs235 20090719]# cat -n size_t.c
1 #include
2 #include
3 int main(void)
4 {
5 size_t a,b;
6 a = 10;
7 b = 20;
8 printf("a - b:%d\n",a-b);
9 printf("1:\n");
10 if ( b > a )
11 printf("b gt a\n");
12 else
13 printf("b lt a\n");
14 printf("2:\n");
15 if ( a - b > 0 )
16 printf("a gt b\n");
17 else
18 printf("a lt b\n");
19
20
21
22 }
[root@bjxdurs235 20090719]# ./a.out
a - b:-10
1:
b gt a
2:
a gt b
size_t 类型的两个数字相减,得到的结果永远不会小于0,啊。
阅读(602) | 评论(0) | 转发(0) |