Comments

When you are writing a program, it often seems clear and self-evident what you are trying to do in the program. Funny thing, though—a month later, when you return to the program, it can be quite confusing and unclear. I'm not sure how that confusion creeps into your program, but it's always there.

To fight the onset of confusion and help others understand your code, you'll want to use comments. Comments are simply text that is ignored by the compiler, but that might inform the reader of what you are doing at any particular point in your program.

Types of Comments

A comment is text that does not affect the operation of the program, but ...

Get Sams Teach Yourself C++ in 24 Hours, Third 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.