Check the value range and size for char type in CSharp
Description
The following code shows how to check the value range and size for char type.
Example
using System;/*from ww w . j ava2 s. c om*/
public class MainClass
{
public static void Main()
{
Console.WriteLine("{0}: bytes: {1}, range: [{2},{3}]",
typeof(char).ToString(), sizeof(char), (int)char.MinValue, (int)char.MaxValue);
}
}
The code above generates the following result.