File inclusion can be done in the following 2 ways:
#include <filename.h>
#include "filename.h"
Each of the format specifies the path to the compiler, to look for inclusion file filename.h
All standard header file like iostream, stdio.h are located in a standard path and they should be included as #include <filename.h>. gcc looks at:
libdir/../include/c++/version
/usr/local/include
libdir/gcc/target/version/include
/usr/target/include
/usr/include
All project specific user defined header files should be included in #include "filename.h" . Compiler now looks into same folder where the file being compiled is present, then at paths specified for compile option -iquote and then -I and then in above mentioned standard paths.
#include <filename.h>
#include "filename.h"
Each of the format specifies the path to the compiler, to look for inclusion file filename.h
All standard header file like iostream, stdio.h are located in a standard path and they should be included as #include <filename.h>. gcc looks at:
libdir/../include/c++/version
/usr/local/include
libdir/gcc/target/version/include
/usr/target/include
/usr/include
All project specific user defined header files should be included in #include "filename.h" . Compiler now looks into same folder where the file being compiled is present, then at paths specified for compile option -iquote and then -I and then in above mentioned standard paths.
Login to comment.
Why create separate log in id? Log in with your
Leave your comment:
