O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comments

A comment is text you add to explain (to yourself or other programmers) why you have done something a particular way in your code. The comment does not make it through the compiler into the program file you actually run—it serves only as documentation.

Comments should not be used to explain everything. Use them to explain the design or why you chose to turn the design into this particular code.

There are two types of comments in C++. The double-slash (//) comment, which is referred to as a C++-style comment, tells the compiler to ignore everything that follows the slashes until the end of the line.

The C-style slash-star (/*) comment mark tells the compiler to ignore everything that follows until it finds a star-slash (*/) comment mark. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required