Книга: Advanced PIC Microcontroller Projects in C

3.1.1 Comments

3.1.1 Comments

Comments are used to clarify the operation of the program or a programming statement. Comment lines are ignored and not compiled by the compiler. In mikroC programs comments can be of two types: long comments, extending several lines, and short comments, occupying only a single line. Comment lines at the beginning of a program can describe briefly the program’s operation and provide the author’s name, the program filename, the date the program was written, and a list of version numbers, together with the modifications in each version. As shown in Figure 3.1, comments can also be added after statements to describe the operations that the statements perform. Clear and succinct comment lines are important for the maintenance and thus the lifetime of a program, as a program with good comments is easier to modify and/or update.

As shown in Figure 3.1, long comments start with the character “/*” and terminate with the character “*/”. Similarly, short comments start with the character “//” and do not need a terminating character.

Оглавление книги


Генерация: 0.048. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз