Array Assignments in C Using Pointer Arithmetic
问题 How can I change the value in an array when I access a particular element using pointer arithmetic? #include <stdio.h> int main() { int a[3] = {1, 1, 1}, b[3] = {2, 2, 2}; a++ = b++; // How can I get this to work so a[1] = b[1]? return 0; } 回答1: Arrays are not pointers. Repeat this three times; arrays are not pointers . You cannot increment an array, it is not an assignable value (i.e., you cannot mutate it). You can of course index into it to get a value back: a[1] = b[1]; Secondly, your