Comments
-
Comments should be placed at key places in a program to make the steps clearer to you and to others.
-
The double forward slashes // are used to denote the start of a comment. The compiler ignores the text between the // and the end of the line.
For example,
// Declaration of variables:
int score, // variable for the exam score
count = 0;
// variable to count the number of students
-
Comments spanning more than a line can be included by enclosing the text by the symbol pair /* and */.
For example,
/* This is an example where the comments span
more than a single line. This feature can be used
during the debugging stage to temporarily omit
certain blocks of code from a program.*/