Tuesday 26 January 2016

#include <> vs #include ""

#include <stdio.h>
When the include file is in brackets the preprocessor,
  1. first searches in paths specified via the -I flag. 
  2. Then it searches the standard include paths (see the above link, and use the -v flag to test on your system).

#include "myFile.h"
When the include file is in quotes the preprocessor,
  1. first searches in the current directory, 
  2. then paths specified by -iquote
  3. then -I paths, 
  4. then the standard paths.

No comments:

Post a Comment