Q & A

Q1:What does #include do?
A1: This is a directive to the preprocessor, which runs when you call your compiler. This specific directive causes the file named after the word include to be read in as if it were typed in at that location in your source code.
Q2:What is the difference between // comments and /* style comments?
A2: The double-slash comments (//) “expire” at the end of the line. Slash-star (/*) comments are in effect until a closing comment (*/). Remember, not even the end of the function terminates a slash-star comment; you must put in the closing comment mark or you will get a compile-time error.
Q3:What differentiates a good comment from a bad comment?
A3: A good comment tells the reader why this particular code is doing whatever ...

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.