logo
  • 教程列表
  • SO官方文档
  • 已选中且未选中
    • 已选中且未选中
    • 选中和取消选中作为范围
  1. StackOverflow 文档
  2. C# Language 教程
  3. 已选中且未选中
  4. 选中和取消选中作为范围

选中和取消选中作为范围

Created: November-22, 2018

关键字还可以创建范围以便(取消)检查多个操作。

short m = 32767;
short n = 32767;
checked
{
    int result1 = (short)(m + n); //will throw an OverflowException
}
unchecked
{
    int result2 = (short)(m + n); // will return -2
}
  • 已选中且未选中

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明