C Header Files Include Syntax

It is very basic but this tutorial has a very clear explanation of the syntax:

#include <file>
This variant is used for system header files. It searches for a file named file in a standard list of system directories. You can prepend directories to this list with the `-I’ option (see section 12. Invocation).

#include "file"
This variant is used for header files of your own program. It searches for a file named file first in the directory containing the current file, then in the same directories used for <file>.

FYI: The “-I” opption is used as:

$ gcc –I path/to/header code.cpp –o output

Leave a Reply

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

www.000webhost.com