Preprocessor directives are explained in Chapter 7, “Preprocessor Directives.”
A “preprocessor directive” is a command to the QuickC compiler, which processes all such commands before it compiles your source program. A preprocessor directive begins with the # symbol, followed by the directive and any arguments the directive needs. Since a preprocessor directive is not a C language statement, it doesn't end in a semicolon.
The two most commonly used directives are #define and #include. Use the #define directive to give a meaningful name to some constant in your program. The following directive tells QuickC to replace PI with 3.14159 everywhere in the source program:
#define PI 3.14159
The #include directive below tells QuickC to insert the contents of a specified file at the current location in your source program.
#include <stdio.h>/* Standard header file */
Such files are called “include files” or “header files.” Standard header files, such as STDIO.H, end with the .H extension and contain function prototypes and other definitions needed for QuickC library routines.
Table 0.4 lists and describes the QuickC standard header files. Consult online help for information on the header files needed by individual library functions.
Table 0.4 QuickC Header Files
File Name | Major Contents |
ASSERT.H | assert debugging macro |
BIOS.H | BIOS service functions |
CONIO.H | Console and port I/O routines |
CTYPE.H | Character classification |
DIRECT.H | Directory control |
DOS.H | MS-DOS interface functions |
ERRNO.H | System-wide error numbers |
FCNTL.H | Flags used in open and sopen functions |
FLOAT.H | Constants needed by math functions |
IO.H | File-handling and low-level I/O |
LIMITS.H | Ranges of integers and character types |
LOCALE.H | Internationalization functions |
MALLOC.H | Memory-allocation functions |
MATH.H | Floating-point math routines |
MEMORY.H | Buffer-manipulation routines |
PROCESS.H | Process-control routines |
SEARCH.H | Searching and sorting functions |
SETJMP.H | setjmp and longjmp functions |
SHARE.H | Flags used in sopen |
SIGNAL.H | Constants used by signal function |
STDARG.H | Macros used to access variable-length argument-list functions |
STDDEF.H | Commonly used data types and values |
STDIO.H | Standard I/O header file |
STDLIB.H | Commonly used library functions |
STRING.H | String-manipulation functions |
TIME.H | General time functions |
VARARGS.H | Variable-length argument-list functions |
SYS\LOCKING.H | Flags used by locking function |
SYS\STAT.H | File-status structures and functions |
SYS\TIMEB.H | time function |
SYS\TYPES.H | File-status and time types |
SYS\UTIME.H | utime function |
WINDOWS.H | Windows API |
CUSTCNTL.H | Custom control library |
DDE.H | DDE window messages and structures |
DRIVINT.H | Printer driver initialization |