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