Possible Duplicate:
what is the difference between #include <filename> and #include “filename”
Is there a fundamental difference between the two #include syntax, apart from the way the path the compiler will search for?
I have the feeling that Intel's compiler does not give exactly the same output.
The fundamental difference is in which paths are searched.
You're supposed to use the angle bracket form for "system" includes, and regular quotes for project-local includes.
The C language standard says that <>
is to be used for "headers" and ""
is to be used for "source files". Now, don't get all up in arms about the "source files" thing. When the standard says "source files", it doesn't mean what you think. The term "source files" as used in the standard encompasses what we colloquially call "header files" (in addition to what we commonly call "source files").
When the standard talks about "headers", it isn't specifically talking about files at all. The standard does not require headers to exist as files. They could be built-in to the compiler for all the standard cares.
So the real difference between <>
and ""
is that <>
is used for headers and ""
is used for files. If you know that the source you'll be including is a file then you should use ""
.
In practice, compilers use different search algorithms for <>
versus ""
. This is allowed by the standard as the search algorithm to be used for either one is implementation defined. But this is not the real difference as expressed by the standard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With