02. STRUCTURE OF A C PROGRAM

Every C program consists of one or more functions. One of the functions must be called main. The program will always begin by executing the main function, which may access other functions. Every C program mast have one main function. Any other function definitions must be defined separately, either ahead of or after main.
Each function must contain: 
1. A function heading, which consist of the  function name, followed by an optional list of arguments, enclosed in parentheses.
2. A list of argument declarations, if arguments are included in the heading.
3. A compound statement, which comprises the remainder of the function.

The arguments are symbols that represent information being passed between the function and other parts of the program.
  Each compound statement is enclosed within a pair of braces. The braces may contain one or more elementary statements and other compound statements. Thus compound statements may be nested, one within another. Each expression statement must end with a semicolon(;).
  Comments may appear anywhere within a program, as long as they are placed within the delimiters /* and */(/*this is a comment */). Such comments are helpful in identifying the program's principal features or in explaining the underlying logic of various program features.
  These program components will be discussed in much greater detail later in this book. For now, the reader should be concerned only with an overview of the basic features that characterize most C programs.
(post by Arnob)

No comments:

Post a Comment

free counters