Initialize char arrays
using System;
class MainClass
{
public static void Main()
{
char[] charArray = new char[] {'h', 'e', 'l', 'l', 'o'};
for (int counter = 0; counter < charArray.Length; counter++)
{
Console.WriteLine("charArray[" + counter + "] = " +
charArray[counter]);
}
}
}
Output charArray[0] = h
charArray[1] = e
charArray[2] = l
charArray[3] = l
charArray[4] = o
|
HTML code for linking to this page:
Related in same category :
-
-
-
|