Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

What is the difference between the #include "file.h" and the #include <file.h>? Surely they mean the exact same thing, because I have a file that has something like this:

#include <file1.h>
#include <file2.h>
#include "file3.h"
#include "file3.h"
share|improve this question

closed as off topic by jw013, manatwork, rahmu, warl0ck, Ulrich Dangel Sep 12 '12 at 15:34

Questions on Unix & Linux Stack Exchange are expected to relate to Unix or Linux within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 5 down vote accepted

This has more to do with C and C++ than Unix, and as such belongs to SO.

To answer your question, the <> indicates headers in the standard library and "" the libraries written specifically for the project.

From the K&R:

Any source line of the form

#include "filename"

or

#include <filename>

is replaced by the contents of the file filename. If the filename is quoted, searching for the file typically begins where the source program was found; if it is not found there, or if the name is enclosed in < and >, searching follows an implementation-defined rule to find the file. An included file may itself contain #include lines

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.