Why isn't this OK?:
error: incompatible types in assignmentCode:int a[6][2] = {{0x1,0x2}, {0x3,0x4}, {0x5,0x6}, {0x7,0x8}, {0x9,0x10}, {0x11,0x12}}; int b[1][2]; b[0] = a[1];
Seems that should be OK.
Why isn't this OK?:
error: incompatible types in assignmentCode:int a[6][2] = {{0x1,0x2}, {0x3,0x4}, {0x5,0x6}, {0x7,0x8}, {0x9,0x10}, {0x11,0x12}}; int b[1][2]; b[0] = a[1];
Seems that should be OK.
You can't assign arrays.
Use memcpy() or a for loop to copy each element one by one.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
OK, thanks.