Unlike C, C++ supports two types of comments. C programmers are familiar with the
/*..*/
style of commenting. Anything lying within the /*..*/
pair is ignored by the compiler. C plus plus (C++) additionally supports the //
notation of commenting.
Here, everything following
Usually
//
till the end of line is treated as comment.Usually
/*..*/
style is used for commenting out of a block code, whereas, //
is used for single-line comments.
Example of single-line comment:
Example of multiple-line comment:
0 comments:
Post a Comment