Does C# allow double semicolon ; ; if so, are there any special ways?

后端 未结 7 1677
盖世英雄少女心
盖世英雄少女心 2020-11-29 12:18

I am writing a statement and it compiles, but the compiler [VS] never tells me that I put the semicolon two times.

This means in ASP.NET MVC 3

return         


        
7条回答
  •  [愿得一人]
    2020-11-29 12:40

    The empty statement is valid in all C-derived languages. The most common idiomatic use is in a for statement, e.g.:

    for (; ; )
    {
    }
    

    if their is a special use of it then show me where two semicolon is required to write a statement in c#

    In the above example, two semicolons are required of course.

提交回复
热议问题