Here is a preprocessor directive in C :
#include <filename>
we can write it in this way also:
#include "filename"
Is there any difference between these two?
In general, the <>
version should look only in "system directories", while the ""
should look in the "local directories" first, and then the system directories.
What that actually means is implementation dependent. In most cases ""
will look in the current directory first, but in some implementations it will look in the directory of the source (.c
) file first (and some compilers have a switch for that). Also, behavior is different w.r.t. the "set of system directories" to search if "local directory search" fails (the same as for <>
or not).