8. Statements

C# provides a variety of statements. Most of these statements will be familiar to developers who have programmed in C and C++.

statement:    labeled-statement    declaration-statement    embedded-statementembedded-statement:    block    empty-statement    expression-statement    selection-statement    iteration-statement    jump-statement    try-statement    checked-statement    unchecked-statement    lock-statement    using-statement    yield-statement

The embedded-statement nonterminal is used for statements that appear within other statements. The use of embedded-statement rather than statement excludes the use of declaration statements and labeled statements in these contexts. The example

void F(bool b) {    if (b)        int ...

Get The C# Programming Language (Covering C# 4.0), Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.