-3

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
sadaf011
  • 7
  • 1
  • 4
  • Amazingly, the top linked question for this has almost exactly the same title. So this question should really not have been that hard to find elsewhere. –  Oct 27 '15 at 15:13
  • Yes there is. And it is very easy to find it out yourself. – Eugene Sh. Oct 27 '15 at 15:13

1 Answers1

-1

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).

srdjan.veljkovic
  • 2,468
  • 16
  • 24