Comments
C++ has two types of comments: block comments and end-of-line comments. Block comments start with a two-character symbol '/*' and end with a two-character symbol '*/'; end-of-line comments start with a two-character symbol '//' and end at—yes, you've guessed it—the end of line; that is, at a next newline character in the source file. The two-character symbols are quite common in C++. Most of them are inherited from C. Using the two-character symbols for operators and in other contexts instead of additional keywords was one of the ways the designers of C managed to design the language with only 30 keywords (and persuaded everyone that C was indeed a very small language).
The characters of two-character symbols (all two-character symbols ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access