This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Showing posts with label C# Arrays. Show all posts
Showing posts with label C# Arrays. Show all posts

Thursday, February 17, 2011

Working with Arrays in C#

Working with Arrays in C#



favorite text editor and type the following C# source code:
using System;
public class ArrayMembers
{
public static void Main(string[] args)
{
//Skip 1 line
Console.WriteLine(“\n”);
//Iterate through the items of array args using foreach
foreach(string s in args)
{
Console.WriteLine(s);
}
//Skip 2 lines
Console.WriteLine(“\n\n”);
//Declare array strNames
string[] strNames = {“Joe”,”Mary”,”Bill”,”Fred”};
//Iterate through the items of array strNames
for(int i = 0;i < strNames.Length;i++)
{
Console.WriteLine(“strNames[{0}] = {1}”,i,strNames[i]);
}
}
}

Whats about C# Arrays

Whats About C# Arrays



Open your favorite text editor and type the following C# source code:
using System;
public class ArrayMembers
{
public static void Main(string[] args)
{
//Skip 1 line
Console.WriteLine("\n");
//Iterate through the items of array args using foreach
foreach(string s in args)
{
Console.WriteLine(s);
}
//Skip 2 lines
Console.WriteLine("\n\n");
//Declare array strNames
string[] strNames = {"Joe","Mary","Bill","Fred"};
//Iterate through the items of array strNames
for(int i = 0;i < strNames.Length;i++)
{
Console.WriteLine("strNames[{0}] = {1}",i,strNames[i]);
}
}
}