PART I
C h a p t e r 7 :
A r r a y s a n d S t r i n g s
151
PART IPART I
CPU usage at node 1 CPU 5: 75%
CPU usage at node 1 CPU 6: 76%
CPU usage at node 2 CPU 0: 70%
CPU usage at node 2 CPU 1: 72%
CPU usage at node 3 CPU 0: 70%
CPU usage at node 3 CPU 1: 73%
CPU usage at node 3 CPU 2: 76%
CPU usage at node 3 CPU 3: 79%
CPU usage at node 3 CPU 4: 82%
Pay special attention to the way
Length
is used on the jagged array
network_nodes
.
Recall, a two-dimensional jagged array is an array of arrays. Thus, when the expression
network_nodes.Length
is used, it obtains the number of
arrays
stored in
network_nodes
, which is four in this case.
To obtain the length of any individual array in the jagged array, you will use an expression
such as this:
network_nodes[0].Length
which, in this case, obtains the length of the first array.
Do'stlaringiz bilan baham: |