Next: A more useful minimal C program Up: The C Program Previous: The C Program

The Minimum C Program

This is the minimum C program:-

It is equivalent to this Pascal program:-

Every C program must have one and only one main() function.

The {} groups statements together and, as can be seen from above, the { is equivalent to begin and the } is the same as end in Pascal.

Comments can be placed anywhere inside C programs using /* and */. These work the same as { and } in Pascal, for example:-

Comments cannot, usually, be nested, so:-

...is illegal.


Dave.Marshall@cm.cf.ac.uk
Wed Sep 14 10:06:31 BST 1994