What is the difference between #include and #include “”?

What is the difference between #include and #include

In C++ it’s common to see two methods of including a header file:

#include <filename>
#include "filename"

The difference between the two varies on the compiler you are using, however the rule of thumb is that the first version, between the “<” and “>”, will have the compiler search for filename in a series of predefined paths. It is the standard to use the #include <filename> form when including header files that are part of the C++ standard library, such as iostream or cstdlib.
The second form of including a header file is meant mostly for custom header files that are located in the same path as the C++ application itself.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top