Sunday 6 November 2016

What are comments in C++ ?

Comments:


Comments are the non-executable and non-compilable statements. The main purpose of the comment is to add comments in your program and also used to add notes about your program to make it readable for others.

There are two types of comments in C++ :
    1. Single Line Comments
    2. Multi-line Comments

Single line Comments:

                           Single line comments are used to comment only one line. Double forward slashes “//” are used for single line comments.

Multi-line Comments:

                         Multi-line comments are used to comment more than one line. Multi-line comment starts with forward slash and asterisk “/*” and ends with asterisk and forward slash “*/”.

No comments:

Post a Comment