<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nano&#039;s Blog &#187; array</title>
	<atom:link href="http://www.nanohe.net/blog/tag/array/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nanohe.net/blog</link>
	<description>Hello World!</description>
	<lastBuildDate>Tue, 20 Jul 2010 09:47:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Arrays in General</title>
		<link>http://www.nanohe.net/blog/2010/01/arrays-in-general/</link>
		<comments>http://www.nanohe.net/blog/2010/01/arrays-in-general/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 06:39:02 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[cs]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=80</guid>
		<description><![CDATA[C# arrays are zero indexed; that is, the array indexes start at zero. Arrays in C# work similarly to how arrays work in most other popular languages There are, however, a few differences that you should be aware of.
When declaring an array, the square brackets ([]) must come after the type, not the identifier. Placing [...]]]></description>
			<content:encoded><![CDATA[<p>C# arrays are zero indexed; that is, the array indexes start at zero. Arrays in C# work similarly to how arrays work in most other popular languages There are, however, a few differences that you should be aware of.</p>
<p>When declaring an array, the square brackets ([]) must come after the type, not the identifier. Placing the brackets after the identifier is not legal syntax in C#.</p>
<pre class="brush: csharp;">
// arrays.cs
using System;
class DeclareArraysSample
{
    public static void Main()
    {
        // Single-dimensional array
        int[] numbers = new int[5];

        // Multidimensional array
        string[,] names = new string[5,4];

        // Array-of-arrays (jagged array)
        byte[][] scores = new byte[5][];

        // Create the jagged array
        for (int i = 0; i &lt; scores.Length; i++)
        {
            scores[i] = new byte[i+3];
        }

        // Print length of each row
        for (int i = 0; i &lt; scores.Length; i++)
        {
            Console.WriteLine(&quot;Length of row {0} is {1}&quot;, i, scores[i].Length);
        }
    }
}
</pre>
<p>Output</p>
<pre class="brush: csharp;">
Length of row 0 is 3
Length of row 1 is 4
Length of row 2 is 5
Length of row 3 is 6
Length of row 4 is 7
</pre>
<p>Using foreach on Arrays</p>
<pre class="brush: csharp;">
using System;
class DeclareArraysSample
{
    public static void Main()
    {
        int[,] numbers = new int[3, 2] { { 9, 99 }, { 3, 33 }, { 5, 55 } };
        foreach (int i in numbers)
        {
            Console.Write(&quot;{0} &quot;, i);
        }
    }
}
</pre>
<p>Output</p>
<pre class="brush: csharp;">
9 99 3 33 5 55
</pre>
<p><em>- from msdn.com</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/01/arrays-in-general/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
