An Unchecked Block Example : unchecked « Data Type « C# / CSharp Tutorial






using System;

public class Program
{
  public static void Main()
  {
          unchecked
          {
             // int.MaxValue equals 2147483647
             int n = int.MaxValue;
              n = n + 1 ;
             System.Console.WriteLine(n);
          }
  }
}








2.49.unchecked
2.49.1.Mark expressions as unchecked
2.49.2.An Unchecked Block Example
2.49.3.unchecked marker
2.49.4.Overflow the max value of a System.Byte