Pre-processor Directives
C is a small language but provides the programmer with all the tools to be able to write powerful programs. C uses libraries of standard functions which are included when we build our programs. For the novice C programmer one of the many questions always asked is does a function already exist for what I want to do? Only experience will help here but we do include a function listing as part of this course.
All programs we will write need to communicate to the outside world. C programs will need at least one of C's standard libraries which deals with standard inputting and outputting of data. This library is called stdin.h and it is declared in our programs before the main function. The .h extension indicates that this is a header file.
C is a free format language and that you can layout your programs how you want to using as much white space as you like. The only exception are statements associated with the pre-processor.
All pre-processor directives begin with a # and the must start in the first column. The commonest directive to all C programs is:
#includeNote the use of the angle brackets (< and >) around the header's name.
These indicate that the header file is to be looked for on the system disk which stores the rest of the C program application.
DO NOT use semi-colons as delimiters! But don't forget the # must be in the first column.