Книга: 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.
- 3.1.1 Comments
- 3.1.2 Beginning and Ending of a Program
- 3.1.3 Terminating Program Statements
- 3.1.4 White Spaces
- 3.1.5 Case Sensitivity
- 3.1.6 Variable Names
- 3.1.7 Variable Types
- 3.1.8 Constants
- 3.1.9 Escape Sequences
- 3.1.10 Static Variables
- 3.1.11 External Variables
- 3.1.12 Volatile Variables
- 3.1.13 Enumerated Variables
- 3.1.14 Arrays
- 3.1.15 Pointers
- 3.1.16 Structures
- 3.1.17 Unions
- 3.1.18 Operators in C
- 3.1.19 Modifying the Flow of Control
- 3.1.20 Mixing mikroC with Assembly Language Statements