Preprocessor Directives
Any line in the source code with a leading #
is taken as a preprocessing directive (or control line), unless #
is within a string literal, in a character constant, or embedded in a comment. The initial #
can be preceded or followed by a whitespace (excluding new lines).
A null directive consists of a line containing the single character #
. This line is always ignored.
Preprocessor directives are usually placed at the beginning of the source code, but they can legally appear at any point in a program. The mikroC PRO for PIC32 preprocessor detects preprocessor directives and parses the tokens embedded in them. A directive is in effect from its declaration to the end of the program file.
Here is one commonly used directive:
#include <math.h>
For more information on including files with the #include
directive, refer to File Inclusion.
The mikroC PRO for PIC32 supports standard preprocessor directives:
# (null directive) #if #define #ifdef #elif #ifndef #else #include #endif #line #error #undef
Line Continuation with Backslash (\)
To break directive into multiple lines end the line with a backslash (\
):
#define MACRO This directive continues to \ the following line.
What do you think about this topic ? Send us feedback!