Skip to content
Mon, Oct 12, 2026 / Ideas for a clearer worldINDEPENDENT INSIGHTS · PRACTICAL TOOLS · EXPLAINERS
Sign in
C++ Programming / August 13, 2021

Comments in C++

C++ supports single line and multi-line comments. All characters available inside any comment are ignored by C++ compiler. C++ comments start with /* and end with */. For example: /* This is a comment */ /* C++ comments can  also  * span multiple lines  */ A comment can also start with //, extending to the […]

C++ supports single line and multi-line comments. All characters available inside any comment are ignored by C++ compiler.

C++ comments start with /* and end with */. For example:

/* This is a comment */

/* C++ comments can  also

 * span multiple lines

 */

A comment can also start with //, extending to the end of the line. For example:

#include<iostream>

usingnamespacestd;

main()

{

cout<<“Hello World”;// prints Hello World

return0;

}