Comments in C++ Programming’s

Posted On
Socialize It →
0
Comments are pieces of code that the compiler discards or ignores or simply does not execute. The purpose of comments is only to allow the programmer to insert some notes or descriptions to enhance readability or understandability of the program. There are two parts to insert comments in C++ programs:

(I) Single Line comments with //.

The comments that begin with // are single line comments. The compiler simply ignores everything following // in that same line.

(II) Multi-line or block comments with /*…*/.


The block comments, mark the beginning of comments with /* and end with */. That means, everything that falls between /*  */ is considered a comment even though it is spread across many lines.

0 comments:

Post a Comment

'