User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
177
Comments
Comments are pieces of a text used to annotate a program and technically are another form of whitespace. Comments
are for the programmer’s use only; they are stripped from the source text before parsing. There are two ways to delineate
comments: the C method and the C++ method. Both are supported by mikroC PRO for PIC32.
You should also follow the guidelines on the use of whitespace and delimiters in comments, discussed later in this topic
to avoid other portability problems.
C comments
C comment is any sequence of characters placed after the symbol pair /*. The comment terminates at the rst
occurance of the pair */ following the initial /*. The entire sequence, including four comment-delimiter symbols, is
replaced by one space after macro expansion.
In the mikroC PRO for PIC32,
int /* type */ i /* identier */;
parses as:
int i;
Note that the mikroC PRO for PIC32 does not support a nonportable token pasting strategy using /**/. For more
information on token pasting, refer to the Preprocessor Operators.
C++ comments
The mikroC PRO for PIC32 allows single-line comments using two adjacent slashes (//). The comment can start in
any position and extends until the next new line.
The following code
int i; // this is a comment
int j;
parses as:
int i;
int j;
Nested comments
ANSI C doesn’t allow nested comments. The attempt to nest a comment like this
/* int /* declaration */ i; */
fails, because the scope of the rst /* ends at the rst */. This gives us
i; */
which would generate a syntax error.