<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FData_Structure%2FArray_Length</id>
		<title>Csharp/CSharp Tutorial/Data Structure/Array Length - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FData_Structure%2FArray_Length"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Array_Length&amp;action=history"/>
		<updated>2026-04-30T04:24:32Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Array_Length&amp;diff=5529&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Array_Length&amp;diff=5529&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Array_Length&amp;diff=5530&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Array_Length&amp;diff=5530&amp;oldid=prev"/>
				<updated>2010-05-26T12:15:50Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Array sizes and dimensions.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
class MainClass {&lt;br /&gt;
    public static void PrintArray(int[] arr) {&lt;br /&gt;
        for (int i = 0; i &amp;lt; arr.Length; ++i)&lt;br /&gt;
            Console.WriteLine(&amp;quot;OneDArray Row {0} = {1}&amp;quot;, i, arr[i]);&lt;br /&gt;
    }&lt;br /&gt;
    public static void PrintArrayRank(int[,] arr) {&lt;br /&gt;
        Console.WriteLine(&amp;quot;PrintArrayRank: {0} dimensions&amp;quot;, arr.Rank);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        int[] x = new int[10];&lt;br /&gt;
        for (int i = 0; i &amp;lt; 10; ++i)&lt;br /&gt;
            x[i] = i;&lt;br /&gt;
        PrintArray(x);&lt;br /&gt;
        int[,] y = new int[10, 20];&lt;br /&gt;
        for (int k = 0; k &amp;lt; 10; ++k)&lt;br /&gt;
            for (int i = 0; i &amp;lt; 20; ++i)&lt;br /&gt;
                y[k, i] = i * k;&lt;br /&gt;
        PrintArrayRank(y);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Defining the Array Size at Runtime==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;class MainClass&lt;br /&gt;
{&lt;br /&gt;
  static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    string[] groceryList;&lt;br /&gt;
    System.Console.Write(&amp;quot;How many items on the list? &amp;quot;);&lt;br /&gt;
    int size = int.Parse(System.Console.ReadLine());&lt;br /&gt;
    groceryList = new string[size];&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the GetLength() method to get number of elements in each dimension of the two dimensional array==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    string[,] names = {&lt;br /&gt;
      {&amp;quot;J&amp;quot;, &amp;quot;M&amp;quot;, &amp;quot;P&amp;quot;},&lt;br /&gt;
      {&amp;quot;S&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;S&amp;quot;},&lt;br /&gt;
      {&amp;quot;C&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;W&amp;quot;},&lt;br /&gt;
      {&amp;quot;G&amp;quot;, &amp;quot;P&amp;quot;, &amp;quot;J&amp;quot;},&lt;br /&gt;
    };&lt;br /&gt;
    int numberOfRows = names.GetLength(0);&lt;br /&gt;
    int numberOfColumns = names.GetLength(1);&lt;br /&gt;
    Console.WriteLine(&amp;quot;Number of rows = &amp;quot; + numberOfRows);&lt;br /&gt;
    Console.WriteLine(&amp;quot;Number of columns = &amp;quot; + numberOfColumns);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Number of rows = 4&lt;br /&gt;
Number of columns = 3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the Length array property==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System; &lt;br /&gt;
 &lt;br /&gt;
class MainClass {  &lt;br /&gt;
  public static void Main() {  &lt;br /&gt;
    int[] nums = new int[10];  &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;Length of nums is &amp;quot; + nums.Length);  &lt;br /&gt;
  &lt;br /&gt;
    Console.Write(&amp;quot;use Length to initialize nums&amp;quot;);&lt;br /&gt;
    for(int i=0; i &amp;lt; nums.Length; i++)  &lt;br /&gt;
      nums[i] = i * i;  &lt;br /&gt;
  &lt;br /&gt;
    Console.Write(&amp;quot;now use Length to display nums&amp;quot;);&lt;br /&gt;
    Console.Write(&amp;quot;Here is nums: &amp;quot;); &lt;br /&gt;
    for(int i=0; i &amp;lt; nums.Length; i++)  &lt;br /&gt;
      Console.Write(nums[i] + &amp;quot; &amp;quot;);  &lt;br /&gt;
  }  &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Length of nums is 10&lt;br /&gt;
use Length to initialize numsnow use Length to display numsHere is nums: 0 1 4 9 16 25 36 49 64 81 &amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the Length array property on a 3-D array==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System; &lt;br /&gt;
 &lt;br /&gt;
class MainClass {  &lt;br /&gt;
  public static void Main() {  &lt;br /&gt;
    int[,,] nums = new int[10, 5, 6];  &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;Length of nums is &amp;quot; + nums.Length);  &lt;br /&gt;
  &lt;br /&gt;
  }  &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Length of nums is 300&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using Length - 1 in the Array Index==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;class MainClass&lt;br /&gt;
{&lt;br /&gt;
  static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    string[] languages = new string[9];&lt;br /&gt;
    languages[4] = languages[languages.Length - 1];&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>