Previous

C++ comments

Next

comments can be used to explain C++ code, To make it more readable.

A comments is take that the compiler ignores .But that is useful for programmers

 

  • There are two type of Comments.

(i) single line comments .+

 

=> single line comments start with two forward slashes (//).

Example:-

int main() {
    // This is comments
 cout << "Hello coder";
 

(ii) multi-line Comments.

multi-line comments start with /* and ends with */ .

Example:-

int main() {
    /*Hello coder This is a multi-line comments*/
 cout << "Hello coder";