为此,要遍历结果数组,每次获取一个单独元素的引用并检索它的属性。
To do that, you go through the results array, each time getting a reference to the individual element and retrieving its attributes.
清单2.使用对一元素数组的最终引用欺骗编译器。
Listing 2. Faking out the compiler with a final reference to a one-element array.
注意subproblem方法没有复制这些元素;它只是将数组引用和偏移复制到一个现有的数据结构中。
Note that the subproblem method does not copy the elements; it merely copies the array reference and offsets into an existing data structure.
为了实现您老板的第一个要求(将子元素转换为属性),需要替换对数组的引用,如清单10所示。
To achieve your boss's first objective, which is to convert elements to attributes, you need to replace references to arrays, as shown in Listing 10.
如果您正在部署该代码,您可能还要检查一下,在引用该数组的第一个元素之前,该数组至少有一个元素。
Note that if you were deploying this code, you would probably also want to check that the array had at least one element before referring to the array's first element.
学习理解匿名数组引用和解除数组元素引用的Perl符号。
Learn to understand the Perl notation for anonymous array references and dereferencing array elements.
两个数组的元素数据类型必须都是引用类型。
The data types of the elements of both arrays must be reference types.
在托管代码中,数组是包含一个或多个相同类型元素的引用类型。
An array is a reference type in managed code that contains one or more elements of the same type.
此外,类型化数组是“稠密的”,即在允许的范围内的每个索引都引用一个元素。
In addition, typed arrays are dense, that is, every index in the allowed range refers to an element.
创建完后,可以以对象的方式或使用数组下标索引的方式引用数组中的元素。
Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
如果集合保证它所含元素的顺序为迭代器的顺序,那么方法必须以相同顺序返回元素。返回的数组是安全的,集合中不会维持对其的引用。
If the collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
如果集合保证它所含元素的顺序为迭代器的顺序,那么方法必须以相同顺序返回元素。返回的数组是安全的,集合中不会维持对其的引用。
If the collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
应用推荐