Consider this code:
struct Test {
int a[4][4];
};
int main()
{
Test t1, t2;
t1 = t2;
return 0;
}
It compiles fine. I ask: what the heck? It happily assigns the array, and not as pointer but it actually COPIES the whole thing correctly (I checked it)! But if I do this:
int main()
{
int a1[4][4], a2[4][4];
a1 = a2;
return 0;
}
I get this error:
error: ISO C++ forbids assignment of arraysSo, can someone clarify me here what the hell is happening? If ISO C++ forbids array assignment, then why does it allow it, if it is inside a struct (or class)? Is it only GCC's behaviour or is it valid C++?
Thanks, and sorry for being a bit off-forum.
--
Greets,
B.
EDIT: I just read, that this is not a general programming board. Well, I already posted, so I apologize, but I promise to keep myself from posting things like this in the future.... IF i get the answer