The preprocessor has a conditional statement similar to C's if else. It can be used to selectively include statements in a program. This is often used where two different computer types implement a feature in different ways. It allows the programmer to produce a program which will run on either type.
The keywords for conditional selection are; #ifdef, #else and #endif.
Where the #ifdef is true, statements between it and a following #else or #endif are included in the program. Where it is false, and there is a following #else, statements between the #else and the following #endif are included.
This is best illustrated by an example.
Go to Using #include Go to Index Go to #ifdef for different computers