C#空语句 [英] C# Empty Statement

查看:115
本文介绍了C#空语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#语言规范定义了语法生成,这使我可以这样做:

The C# language specification defines the empty-statement grammar production, which allows me to do something like this:

static void Main(string[] args)
{
    ; ; ;
}

为什么Microsoft将这种语法生产包含在C#语言中?是否有用处?

Why would Microsoft include this grammar production in the C# language? Does it have a useful purpose?

推荐答案

while (GetWhitespace(textStream))
    ;

这篇关于C#空语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆