Abl-electronic PIC Microcontrollers PIC16 Manuel d'utilisateur Page 138

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 312
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 137
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 .c) —
see Projects for more information.
The syntax of
#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 the header file at that point in the source code. The placement of the #include
can therefore influence the scope and duration of any identifiers in the included
file.
The difference between the two formats lies in the searching algorithm employed
in trying to locate the include file.
If
#include directive was used with the <
header_name
> version, the search is
made successively in each of the following locations, in this particular order:
1. mikroC installation folder > “include” folder,
2. your custom search paths.
The
"
header_name
" version specifies a user-supplied include file; mikroC will
look for the header file in following locations, in this particular order:
1. the project folder (folder which contains the project file
.ppc),
2. mikroC installation folder > “include” folder,
3. your custom search paths.
Explicit Path
If you place an explicit path in the
header_name, only that directory will be
searched. For example:
#include "C:\my_files\test.h"
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
130
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Vue de la page 137
1 2 ... 133 134 135 136 137 138 139 140 141 142 143 ... 311 312

Commentaires sur ces manuels

Pas de commentaire