私はこのようなプログラムを持っています:
class A {
int a[2][3];
public:
A(int b[2][3]): a(b) {};
};
int main() {
int b[2][3];
A myclass(b);
return 1;
}
コンパイラは次のように述べています。
1.cpp: In constructor 'A::A(int (*)[3])':
1.cpp:5:22: error: incompatible types in assignment of 'int (*)[3]' to 'int [2][3]'
なぜそれらは互換性がなく、配列 A::a を別の配列 b で初期化するにはどうすればよいですか?