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. ...

Get SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.