General Syntax

Basic C-language syntax is explained in Chapter 1, “Anatomy of a C Program.”

A C statement consists of keywords, expressions, and function calls. A statement always ends with a semicolon. A statement block is a collection of statements enclosed by braces ({ }). A statement block can appear anywhere a simple C statement appears. No semicolon occurs after the closing brace.

C is a free-format programming language. You can insert “whitespace” characters (spaces, tabs, carriage returns, and form feeds) almost anywhere, to indent statement blocks and otherwise make your code more readable.

Comments begin with the slash-asterisk sequence (/*) and end with the asterisk-slash sequence (*/). Comments are legal anywhere a space is legal, but they cannot be nested.