Is there a shorter way to initialize an array of structs?
有一个较短的方式来初始化一个数组的结构?
Listing 5-8 demonstrates how to construct and initialize an array and two classes from the generic collection library.
清单5 - 8演示了如何构造并初始化一个数组和两个一般集合库中的类。
How to initialize an array of objects?
如何初始化一个对象数组?
How can I initialize an array of previously defined arrays at compilation time?
我如何初始化数组的先前定义的阵列在编译的时候?
How to initialize an array with unknown length?
如何初始化一个未知长度的数组?
The parentheses are effectively a request to the compiler to value-initialize the array, which in this case sets its elements to 0.
圆括号要求编译器对数组做值初始化,在本例中即把数组元素都设置为0。
An array literal cannot initialize a multidimensional typed array, but an array literal can initialize a typed array of typed arrays.
数组标识符不能初始化多维类型化数组,但可以初始化类型化数组的类型化数组。
First, the array literal is converted to a typed array, which is used to initialize the typed array.
首先,将数组标识符转换为类型化数组,后者用于初始化类型化数组。
When we allocate an array of objects of a class type, then that type's default constructor ( Section 2.3.4, p. 50) is used to initialize each element.
动态分配数组时,如果数组元素具有类类型,将使用该类的默认构造函数( 第2.3.4节)实现初始化;
You can initialize a pointer by using an array, a string, a fixed-size buffer, or the address of a variable.
可通过使用数组、字符串、大小固定的缓冲区或变量地址初始化指针。
Gets the initializers with which to initialize the array.
获取或设置要创建的数组类型。
Gets the initializers with which to initialize the array.
获取或设置要创建的数组类型。
应用推荐