영어로 읽는 코딩

22 [C] 문장과 블럭

Statements and Blocks (문장과 블럭)

 

An expression such as x = 0 or i++ or printf( ... ) becomes a statement when it is followed by a semicolon, as in

 

  x = 0;

  i++;

  printf( ... );

 

In C, the semicolon is a statement terminator, rather than a separator as it is in languages like Pascal.

 

Braces { and } are used to group declarations and statements together into a compound statement (복합문), or block, so that they are syntactically equivalent to a single statement. The braces that surround the statements of a function are one obvious example; braces around multiple statements after an if, else, while, or for are another. (Variables can be declared inside any block; we will talk about this in Chapter 4.) There is no semicolon after the right brace that ends a block.

 

 

[The C Programming Language p.55]

댓글

댓글 본문
버전 관리
Yoo Moon Il
현재 버전
선택 버전
graphittie 자세히 보기