Menu

C++ TUTORIALS - C++ Comments

C++ Comments

ADVERTISEMENTS

/* This is a comment */

/* C++ comments can  also
 * span multiple lines
 */

ADVERTISEMENTS

#include <iostream>
using namespace std;

main()
{
   cout << "Hello World"; // prints Hello World

   return 0;
}

ADVERTISEMENTS

Hello World

/* Comment out printing of Hello World:

cout << "Hello World"; // prints Hello World

*/