C语言数组赋值问题,第四行输出lvalue required as left operand of assignment,如果a[n] == *(a+n),那这样为数组元素赋值为什么不可以?求解释。
int a[3] = {1, 2, 3};
int t = *a+1;
printf("%d\n", t);
*a+1 = 3;
printf("%d", *a+1);
...全文
1164打赏收藏
C语言数组赋值问题
C语言数组赋值问题,第四行输出lvalue required as left operand of assignment,如果a[n] == *(a+n),那这样为数组元素赋值为什么不可以?求解释。 int a[3] = {1, 2, 3}; int t = *a+1; printf("%d\n", t); *a+1 = 3; printf("%d", *a+1);