Google News
logo
CPP - Interview Questions
What are the Comments in C++?
Comments in C++ are simply a piece of source code ignored by the compiler. They are only helpful for a programmer to add a description or additional information about their source code.
 
In C++ there are two ways to add comments :
//single-line comment
/* block comment */
The first type will discard everything after the compiler encounters “//”. In the second type, the compiler discards everything between “/*” and “*/”.
Advertisement