对C语言连等式的学习

例子如下

[pgsql@localhost soft]$ cat test1.c
#include <stdlib.h>
#include <stdio.h>

int main()
{
   int a,b,c;
   a = 10;
   b =20;
   c = 30;

   a = b =c;

   fprintf(stderr,"a :%d\n",a);
   fprintf(stderr,"b :%d\n",b);
   fprintf(stderr,"c :%d\n",c);

   return 0;
}
[pgsql@localhost soft]$ 

运行:

[pgsql@localhost soft]$ ./test1
a :30
b :30
c :30

得出结论,赋值从右边向左边进行

posted @ 2013-08-05 10:46  健哥的数据花园  阅读(1825)  评论(0编辑  收藏  举报