C# Empty Statement

后端 未结 13 2360
情深已故
情深已故 2020-11-29 12:34

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

static void Main(string[] a         


        
13条回答
  •  孤街浪徒
    2020-11-29 13:03

    Good practice or not, some people use this:

    while (!SomeCondition)
        ; // <-- body of the while loop is an empty statement
    

提交回复
热议问题