// Pass array as parameter.
int[] ages = {20, 22, 23, 0} ;
PrintArray(ages);
// Get array as return value.
string[] strs = GetStringArray();
foreach(string s in strs)
Console.WriteLine(s);
Console.WriteLine();
}
So, at this point you hopefully feel comfortable with the process of defining, filling, and exam-
ining the contents of a C# array type. To complete the picture, let’s now examine the role of the
System.Array class.
The System.Array Base Class
Every array you create gathers much of its functionality from the System.Array class. Using these
common members, we are able to operate on an array using a consistent object model. Table 4-2
gives a rundown of some of the more interesting members (be sure to check the .NET Framework
3.5 SDK for full details).
Table 4-2.
Select Members of System.Array
Do'stlaringiz bilan baham: |