Datasheet

FILE INCLUSION
The preprocessor directive #include pulls in header files (extension .h) into the
source code. Do not rely on preprocessor to include source files (extension ) — see
Add/Remove Files from Project for more information.
The syntax of the
#include directive has two formats:
#include <header_name>
#include "header_name"
The preprocessor removes the #include line and replaces it with the entire text of
a header file at that point in the source code. The placement of #include can there-
fore influence the scope and duration of any identifiers in the included file.
The difference between these two formats lies in searching algorithm employed in
trying to locate the include file.
If the #include directive is used with the <header_name> version, the search is
made successively in each of the following locations, in this particular order:
1. the mikroC PRO for AVR installation folder › “include” folder
2. user's custom search paths
The
"header_name" version specifies a user-supplied include file; the mikroC PRO
for AVR will look for the header file in the following locations, in this particular order:
1. the project folder (folder which contains the project file .ppc)
2. the mikroC PRO for AVR installation folder › “include” folder
3. user's custom search paths
Explicit Path
By placing an explicit path in header_name, only that directory will be searched. For
example:
#include "C:\my_files\test.h"
Note
There is also a third version of the #include directive, rarely used, which assumes that
neither < nor " appear as the first non-whitespace character following #include:
#include macro_identifier
It assumes that macro definition that will expand macro identifier into a valid delimit-
ed header name with either <header_name> or "header_name" formats exists.
223
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroC PRO for AVR
CHAPTER 5