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;

}

Related Posts

© 2024 Software Engineering - Theme by WPEnjoy · Powered by WordPress