L
Lionel B
Hi,
I am trying to get my head around this:
int main()
{
typedef int array1[3];
array1 x,y;
y = x; // error: invalid array assignment
struct array2
{
array1 x;
};
array2 a,b;
b = a; // OK, assigns b.x element-wise from a.x
}
Now for array2, since no assignment op is defined, as I understand it a
default assignment op will be invoked which simply assigns individual
members of struct array2... but the only member of array2 is an array1...
which cannot be assigned. What is happening here?
I am trying to get my head around this:
int main()
{
typedef int array1[3];
array1 x,y;
y = x; // error: invalid array assignment
struct array2
{
array1 x;
};
array2 a,b;
b = a; // OK, assigns b.x element-wise from a.x
}
Now for array2, since no assignment op is defined, as I understand it a
default assignment op will be invoked which simply assigns individual
members of struct array2... but the only member of array2 is an array1...
which cannot be assigned. What is happening here?