码迷,mamicode.com
首页 > 其他好文 > 详细

goto语句

时间:2018-09-28 23:26:32      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:lin   语句   []   位置   read   domain   定义   标签   line   

让程序直接跳到自定义标签位置

        public static void Main(string[] args)
        {
            int a=5;
            goto myLabel;AppDomainInitializer//直接跳到标签myLabel位置
            a++;
            myLabel:Console.WriteLine(a);//5
            Console.WriteLine(a);
            Console.ReadKey();
        }

 

goto语句

标签:lin   语句   []   位置   read   domain   定义   标签   line   

原文地址:https://www.cnblogs.com/xixixing/p/9721397.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!