PROGRAMMING PIC MICROCONTROLLERS IN C:COMMENTS IN PROGRAMS

COMMENTS IN PROGRAMS

Comments can be used in programs for clarification purposes. The comment lines are ignored by the compiler. There are two ways of including comments in a program. One way is to use double slashes (‘//’) before a comment line. Any characters after the double slashes (‘//’) are ignored by the compiler. For example,

Programming PIC Microcontrollers in C-0107

Comment lines starting with the ‘//’ characters can be used anywhere in a program.

Another way of creating comment lines in a program is to start the comments with the characters ‘/*’, insert the comments, and then terminate the comments with the ‘*/’ characters.

This method has the advantage that the comments can extend to several lines. An example is given below:

Programming PIC Microcontrollers in C-0108

Leave a comment

Your email address will not be published. Required fields are marked *