#include is a C (and C style) preprocessor statement. It doesn't have to be at the top of your code (but that's just being anal, because it usually is). One important thing to note is that it doesn't define the libraries the code uses; it simply inserts the contents of the given file into the part of the file where the #include statement resides (from the compiler's point of view anyway). Coincidentally, the libraries you wish to use are linked with your code by the linker, not the compiler; header files just define or prototype functions exported by these libraries. Some of the most ingenius hacks submitted to the IOCCC rely in various strange #includes.