Chapter Summary

I l @ ve RuBoard

Chapter Summary

A C program consists of one or more C functions. Every C program must contain a function called main() because it is the function called when the program starts up. A simple function consists of a header followed by an opening brace, followed by the statements constituting the function body, followed by a terminating, or closing, brace .

Each C statement is an instruction to the computer and is marked by a terminating semicolon. A declaration statement creates a name for a variable and identifies the type of data to be stored in the variable. An assignment statement assigns a value to a variable or, more generally , to a storage area. A function call statement causes the named function to be executed. When the called function is done, the program returns to the next statement after the function call.

The printf() function can be used to print phrases and the values of variables .

The syntax of a language is the set of rules that governs the way in which valid statements in that language are put together. The semantics of a statement is its meaning. The compiler helps you detect syntax errors, but semantic errors show up in a program's behavior only after it is compiled. Detecting semantic errors may involve tracing the program state ”that is, the values of all variables ”after each program step.

Keywords are the vocabulary of the C language.

I l @ ve RuBoard


C++ Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 314
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net