For example, in ANSI C, the function to delete a file is remove . On older Unix systems, however, the function was called unlink . You want to compile several different versions of your program, with different features present in the different versions. This way, you can build the several different versions from the same source code.
Conditional compilation can be very handy, but it can also get out of hand.
Also, if you are using an ANSI Standard compiler and you are writing ANSI-compatible code, you usually won't need so much conditional compilation, because the Standard specifies exactly how the compiler must do certain things, and exactly which library functions it much provide, so you don't have to work so hard to accommodate the old variations among compilers and libraries.