Cast an int into a char : Data Type Cast : Data Type C# Examples


C# Examples » Data Type » Data Type Cast »

 

Cast an int into a char









    
using  System;  
  
class  Example  {        
    public  static  void  Main()  {        
        byte  b;  
        char  ch;  

        b  =  88;  //  ASCII  code  for  X  
        ch  =  (char)  b;  
        Console.WriteLine("ch  after  assigning  88:  "  +  ch);    

    }
}
    
   
  
   



Output

ch after assigning 88: X


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Data Type Cast