typedef struct {
int p[10];
} array10;
int main() {
array10 a = {(int[10]){...}};
array10 b = {(int[10]){...}};
a.p = b.p; // #1. doesn't compile, can't assign to int[10]
a = b; // #2. successfully assigns b.p to a.p
}
Although I understand what's happening here, I found it curious: If #2 works, then why isn't #1 in the language? You can assign to static arrays (and thus pass them by value) as long as they're wrapped in a struct. Am I missing something about the philosophy of the C that makes this intuitive?