Mega Code Archive

 
Categories / C# Book / 01 Language Basics
 

0030 char type

char(System.Char) type from C# uses two bytes to store unicode character. C# uses single quote to wrap char type literal. The following code stores character a to char type variable: using System; class Program { static void Main(string[] args) { char ch = 'a'; Console.WriteLine(ch); } } The output: a