Use of Comment in C++ Programming Language. Multi-line Comment and End-of-line Comment in C++

 


Comments:

Comments are used to document and explain your codes and program logic.

Comments are not programming statements and are ignored by the compiler

There are two kinds of comments in C++:

  • Multi - line Comment : begins with a /* and ends with a */, and can span several lines.
  • End - of - line Comment : begins with // and lasts till the end of the current line.

Example of Multi-line Comment:

Use of Comment in C++ Programming Language. Multi-line Comment
Use of Comment in C++ Programming Language. Multi-line Comments Example in C++

Example of End - of - line Comment:

Use of Comment in C++ Programming Language. End-of-line Comment in C++
Use of Comment in C++ Programming Language. End-of-line Comment Example in C++


Post a Comment

1 Comments