Don't understand why
#include <Header.h>
is not compiling while #include "Header.h"
is compiling with Visual Studio 2008. Am I missing something?
views:
89answers:
3
+5
A:
The two forms of #include
search for headers differently.
You can find which paths are searched for each form in the #include
MSDN documentation.
James McNellis
2010-10-14 06:02:33
+2
A:
when you mention header file <>, it looks in standard includes, but when header file is included with "", starts with current directory,then will look at standard includes. Here, in this case, Header.h is in current directory, may not be in standard includes.
Koteswara sarma
2010-10-14 06:03:23
+1 for trying to document the relevant behavioural difference, but "current directory" could easily be misunderstood. E.g. (not worded too well) it may initially be the "current working directory" from the compiler's perspective, but a header included from any directory can find other headers using a relative path in double quotes...
Tony
2010-10-14 06:18:48
+3
A:
They have different purposes.
The brackets <
and >
are for standard header files, while the quotes "
are for your header files.
Here is another question with more information regarding this:
tster
2010-10-14 06:03:42