对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
",a);
   fprintf(stderr,"b :%d
",b);
   fprintf(stderr,"c :%d
",c);

   return 0;
}
[pgsql@localhost soft]$ 

运行:

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

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

原文地址:https://www.cnblogs.com/gaojian/p/3237723.html