二维数组和数组数组有什么区别?
What is the difference between a 2D array and an array of arrays?
我已阅读评论,例如 @Dave's,这似乎区分了两者.
I have read comments, such as @Dave's, that seem to differentiate between the two.
如果他使用二维数组或指向数组的类型,而不是数组的数组,这会中断.– 戴夫
This breaks if he's using 2d arrays, or pointer-to-array types, rather than an array of arrays. – Dave
我一直认为两者都指的是:
I always thought that both referred to:
int arr_arr[][];
<小时>
@FutureReader,您可能希望看到 如何在 C++ 中使用数组?
@FutureReader, you may wish to see How do I use arrays in C++?
二维数组是定义为数组的数组.
A 2 dimensional array is by definition an array of arrays.
Dave 所说的是,在这种情况下,像这样的二维数组定义之间存在不同的语义:
What Dave was saying is that in that context, there are different semantics between the definition of a 2D array like this:
int x[][];
这个:
int *x[];
或者这个:
int **x;
这篇关于二维数组与数组数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
fpermissive 标志有什么作用?What does the fpermissive flag do?(fpermissive 标志有什么作用?)
如何在我不想编辑的第 3 方代码中禁用来自 gccHow do you disable the unused variable warnings coming out of gcc in 3rd party code I do not wish to edit?(如何在我不想编辑的第 3 方代码中禁
使用 GCC 预编译头文件Precompiled headers with GCC(使用 GCC 预编译头文件)
如何在 OS X 中包含 omp.h?How to include omp.h in OS X?(如何在 OS X 中包含 omp.h?)
如何让 GCC 将 .text 部分编译为可写在 ELF 二进制文How can I make GCC compile the .text section as writable in an ELF binary?(如何让 GCC 将 .text 部分编译为可写在 ELF 二进制文件中?)
GCC、字符串化和内联 GLSL?GCC, stringification, and inline GLSL?(GCC、字符串化和内联 GLSL?)