Skip to content
Saturday, November 28, 2026Ideas worth exploring. Knowledge worth sharing.
S. SenseCentralDISCOVER EVERY DAY
C++ Programming

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 end of the line. For example:

#include<iostream>

usingnamespacestd;

main()

{

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

return0;

}

Author

  • A senior editor for The Mars that left the company to join the team of SenseCentral as a news editor and content creator. An artist by nature who enjoys video games, guitars, action figures, cooking, painting, drawing and good music.

WRITTEN BY

Taylor Emma

A senior editor for The Mars that left the company to join the team of SenseCentral as a news editor and content creator. An artist by nature who enjoys video games, guitars, action figures, cooking, painting, drawing and good music.

More from this author ↗

Leave a Reply

Your email address will not be published. Required fields are marked *