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

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

问题描述

C# 语言规范定义了 empty-statement 语法产生,它允许我做这样的事情:

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天全站免登陆