Possible Duplicate:
what is the difference between #include <filename> and #include “filename”
In both cases there is no error ...Is there any difference between them ?
Possible Duplicate:
what is the difference between #include <filename> and #include “filename”
In both cases there is no error ...Is there any difference between them ?
<stdio.h> searches in standard C library locations, whereas "stdio.h" searches in the current directory as well.
Ideally, you would use <...> for standard C libraries and "..." for libraries that you write and are present in the current directory.
"...", the only difference is that your .h file will be searched for in the current directory as well as the standard C library locations.The second version is specified to search first in an implementation defined location, and afterwards if the file is not found, search in the same place as the <...> version, which searches in the paths usually specified by the -I command line option and by built-in include paths (pointing to the location of the standard library and system headers).
Usually, implementations define that location to be relative to the location of the including file.
You use #include when you want to say: "look for a file with this name in the system's include directory". You use #include "doublequoted" when you want to say: "look for a file with this name in my own application's include directory; however, if it can't be found, look in the system's include directory".
#include <something.h> is meant for system headers, while #include "something.h" is for headers of your own program. System headers are searched for in usual system directories (and those included with -I argument), which your headers are searched for in current directory and then the same locations as system headers.
see http://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC6
<stdio.h> refers to a header (not a header file)
"stdio.h" refers to a source file.
Headers need not exist phisically in the implementation; the way they are identified is implementation-defined (usually the headers are files on specific directories)
When the directive uses ", the source file is searched in an implementation-defined manner and, if not found, the directive is reprocessed as if it was written with < and > in the first place.
#include <unistd.h> is not valid because unistd.h is not a header? Or is there another reason that it uses "header" for <...> but "source file" for "..."?unistd.h is a header if the implementation (or in this case the POSIX standard, which the implementation also implements) says it's a header. It's not a standard header, but I don't think the C99 standard forbids implementations from allowing headers other than the standard ones. I can't find anywhere that explicitly permits it either, just the text about the mapping from identifiers to headers being implementation-defined.unistd.h is a header if the implementation says so. The Standard is quiet about the effect of including something not a header. Apparently my implementation defines unistd.h as a header, but doesn't define windows.h ...The difference is that header files made by the developer are enclosed by "". Header files that are already in the system are enclosed with <>. Even the <> headers need the -I directive if the directories that are placed are not in the search path of the compiler.
Bottom line: Your headers with "", system headers with <>