int a=5,count=0;
while(--a) count++;
printf("a is%d count is%d\n",a,count);
结果:
a is 0 count is 4
int a=5,count=0;
while(a--) count++;
printf("a is%d count is%d\n",a,count);
结果:
a is -1 count is 5
int a=5,count=0;
while(--a) count++;
printf("a is%d count is%d\n",a,count);
结果:
a is 0 count is 4
int a=5,count=0;
while(a--) count++;
printf("a is%d count is%d\n",a,count);
结果:
a is -1 count is 5