Assign values to char array elements : Char array : Data Type C# Examples


C# Examples » Data Type » Char array »

 

Assign values to char array elements









    
using  System;

class  MainClass
{
    static  void  Main(string[]  args)
    {
        char[]  MyChar  =  new  char[6];

        MyChar[0]  =  'H';
        MyChar[1]  =  'e';
        MyChar[2]  =  'l';
        MyChar[3]  =  'l';
        MyChar[4]  =  'o';
        MyChar[5]  =  '\0';


                Console.WriteLine(MyChar);
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Char array