using System;
using System.Collections;
using System.Collections.Generic;
namespace Csharp
{
class Program
{
static void Main(string[] args)
{
byte b=255;
//不检查溢出错误
unchecked
{
b++;
}
//检查溢出错误
checked
{
b++;
}
Console.WriteLine(b);
Console.ReadKey();
}
}
}
C# checked和unchecked
最新推荐文章于 2024-01-30 23:26:58 发布