Skip to content

Latest commit

 

History

History
45 lines (43 loc) · 1.58 KB

File metadata and controls

45 lines (43 loc) · 1.58 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision ms.author manager translation.priority.ht
Blocks
na
10/14/2016
visual-studio-dev14
na
na
devlang-cpp
na
article
C++
C
function definitions, blocks in code
blocks
compound statements
statements, compound
be231a92-c712-464e-ae25-a4becb20f7f5
7
mithom
ghogen
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

Blocks

A sequence of declarations, definitions, and statements enclosed within curly braces ({ }) is called a "block." There are two types of blocks in C. The "compound statement," a statement composed of one or more statements (see The Compound Statement), is one type of block. The other, the "function definition," consists of a compound statement (the body of the function) plus the function's associated "header" (the function name, return type, and formal parameters). A block within other blocks is said to be "nested."

Note that while all compound statements are enclosed within curly braces, not everything enclosed within curly braces constitutes a compound statement. For example, although the specifications of array, structure, or enumeration elements can appear within curly braces, they are not compound statements.

See Also

Source Files and Source Programs