c++数组/指针声明问题
c++ array/pointer declarations issue
我正在尝试解决c++中以下三个声明之间的差异。我附加了我的猜测:
-
const float *x[4]
-常量浮点数数组指针的四元素数组 -
const float (*x)[4]
-我在这里很困惑…和上面一样吗? -
const float *(*x)[4]
-与上面相同,但"在常量浮点数数组的数组上"
使用cdecl
来了解声明,
-
const float *x[4]
-声明x为指向const float 的指针的数组4 -
const float (*x)[4]
-声明x为指向const float 数组4的指针 -
const float *(*x)[4]
-声明x为指向const float 指针的指向数组4的指针
来源:cdecl.org
const float *x[4] - 4-element array of pointers on arrays of constant floats
指向常量浮点数的四元素指针数组。
const float (*x)[4] - I'm confused here... is it the same as above?
指向四元素常量浮点数数组的指针。
const float *(*x)[4] - the same as above but "on arrays of arrays of constant floats"
指向常量浮点数指针的四元素数组。
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
相关文章:
- Visual Studio中的函数声明和函数定义问题
- 如何在标头中声明(或定义)函数的问题
- 在顶点着色器中使用 OpenGl 的未声明标识符,我在顶点着色器中绘制三角形时遇到问题
- 如何解决这个正向类声明问题
- NetBeans IDE 8.2 C++字符串声明问题
- C++通告声明问题
- 外部变量和数组声明问题C
- 错误C2447,应为声明问题
- 面向C++的main.cpp中的可视化结构声明问题
- C++/CLI转发声明问题
- C++中跨源文件的函数声明问题
- 这个简单(?C++字符串声明问题似乎已经击败了StackExchange
- 前向声明问题:嵌套名称说明符中使用的类型不完整'enums::Category'
- c++数组/指针声明问题
- 编译时Time_t声明问题
- 类声明问题
- 命名空间和前向声明问题
- 成员类声明问题
- QT c++前向声明问题
- C++数组声明问题