C++ で次の 3 つの宣言の違いを解決しようとしています。私は私の推測を追加しました:
const float *x[4]
- 定数 float の配列上のポインターの 4 要素配列const float (*x)[4]
-ここで混乱しています...上記と同じですか?const float *(*x)[4]
- 上記と同じですが、「定数浮動小数点数の配列の配列」
ヘルプ/説明をいただければ幸いです。
C++ で次の 3 つの宣言の違いを解決しようとしています。私は私の推測を追加しました:
const float *x[4]
- 定数 float の配列上のポインターの 4 要素配列const float (*x)[4]
-ここで混乱しています...上記と同じですか?const float *(*x)[4]
- 上記と同じですが、「定数浮動小数点数の配列の配列」ヘルプ/説明をいただければ幸いです。
cdecl
宣言を知るために使用し、
const float *x[4]
- const float へのポインターの配列 4 として x を宣言します。const float (*x)[4]
- xを const float の配列 4 へのポインターとして宣言するconst float *(*x)[4]
- const float へのポインターの配列 4 へのポインターとして x を宣言します。ソース: cdecl.org
const float *x[4] - 4-element array of pointers on arrays of constant floats
定数浮動小数点数へのポインターの 4 要素配列。
const float (*x)[4] - I'm confused here... is it the same as above?
定数浮動小数点数の 4 要素配列へのポインター。
const float *(*x)[4] - the same as above but "on arrays of arrays of constant floats"
定数浮動小数点数へのポインターの 4 要素配列へのポインター。
const float *x[4] - An array of pointers to constant floats
const float (*x)[4] - A pointer to an constant float array with 4 elements
const float *(*x)[4] - A pointer to an array of pointers to constant float