[] 和 ++ 哪个优先级更高? 答曰: []

来源:互联网 发布:马克西姆和朗朗知乎 编辑:程序博客网 时间:2024/04/28 18:54
      1 int main()
      2 {
      3     int i = 0;
      4     int a[3] = { 0 };
      5     a[i++] = 1;
      6     printf("a[0] = %d, a[1] = %d/n", a[0], a[1]);
      7     return 0;
      8 }

~/testbench> gcc -o test2plus test2plus.c
test2plus.c: In function 'main':
test2plus.c:6: warning: incompatible implicit declaration of built-in function 'printf'
~/testbench> ./test2plus
a[0] = 1, a[1] = 0



原创粉丝点击