こんにちは、次のコードを試しました:
int *a=&matrice[4][0];
cout<<*a<<"\n\n";
int *b;
b = &matrice[4,4];
行列は次のように定義されています:int matrice[5][5];
通常の int 値で埋めました。
最初の割り当ては機能しますが、2 番目の割り当てはエラーで機能しません。
a value of type "int (*)[5]" cannot be assigned to an entity of type "int * "
.
どちらもコンパイル時にエラーになると思っていました。
この異なる動作がある理由を説明できますか?