Sunday, February 5, 2012

What is the difference between #include <...> and #include "..."

There are two ways to include a header file :

#include "stdio.h"
#include<stdio.h>

If you use the double quote marks , it  means that the directory you're currently in will be searched first , for the header file , before any other directories( mentioned in the INCLUDE_PATH ) are searched.

When you use the angled brackets , directories other than the one you're currently in , will be searched for the header file. The system dependent directories are searched. Usually this will be the default directory for header files specified in your compiler, so you'll probably be using square brackets all the time.

No comments:

Post a Comment