Glossary: Compound Statement

A compound statement consists of none or more C++ statements enclosed within a set of braces: {}. It is an essential concept in C++ and is central to the idea of nesting constructs. For example, the if statement has the form:-
if ( expression ) statement
which would severely limit it use were it not for the fact that a compound statement is an example of a statement. Consequently the if can conditionally execute as many statements as required and these may include other if and compound ones.

See {..}


Go Back to the The Glossary Top Page


If you have any comments about this page please send them to Nick West