Comments are parts of the source code disregarded by the compiler. They simply do nothing. Their purpose is only
to allow the programmer to insert notes or descriptions embedded within the source code.
C++ supports two ways to insert comments:
The first of them, known as line comment, discards everything from where the pair of slash signs (//) is found up
to the end of that same line. The second one, knownas block comment, discards everything between the /*
characters and the first appearance of the */characters, with the possibility of including morethan one line.
We are going to add comments to our second program:
If you include comments within the source code of your programs without using the comment characters
combinations //, /*or */, the compiler will take them as if they were C++ expressions, most likely causing one or
several error messages when you compile it.
to allow the programmer to insert notes or descriptions embedded within the source code.
C++ supports two ways to insert comments:
The first of them, known as line comment, discards everything from where the pair of slash signs (//) is found up
to the end of that same line. The second one, knownas block comment, discards everything between the /*
characters and the first appearance of the */characters, with the possibility of including morethan one line.
We are going to add comments to our second program:
If you include comments within the source code of your programs without using the comment characters
combinations //, /*or */, the compiler will take them as if they were C++ expressions, most likely causing one or
several error messages when you compile it.
No comments:
Post a Comment