class Program
{
static void Main(string[] args)
{
Int64 a = Int64.MaxValue;
Int64 b= Int64.MinValue;
try
{
checked
{
Int64 m = a * b;
}
}
catch (OverflowException ex)
{
Console.WriteLine("over flow exception");
Console.Read();
}
}
}
如果变量声明为int,我得到编译错误,转换从requreid从int到long。别名为int32,int64
- 为什么我得到这个错误,虽然我使用int。
- 什么别名
Int32
和Int64
- 当使用
Int32
和Int64
,它依赖于操作系统?
可能重复的[Int32与Int64与C#中的Int](http://stackoverflow.com/questions/1680111/int32-vs-int64-vs-int-in-c) – LukeH 2011-03-22 16:30:53