Chapter 2

Using Advanced C++ Features

IN THIS CHAPTER

check Using comments

check Working with conversions, consoles, and preprocessor directives

check Manipulating constants, enums, and random numbers

check Structuring code and data with switches and arrays

This chapter will amaze you because C++ has amazing advanced features. It begins by helping you understand how to leave notes for yourself so that you don’t embarrass yourself in front of your boss when you forget how your code works. Comments can do a lot more, but for the most part, they’re there to help you remember.

The next sections are all about helping your code jump through new hoops. You discover that you can turn an int into a string, connect with the user at the command line, and tell the compiler to do something new with your code as part of a preprocessor directive. In case that isn’t enough, you also find out new ways to create variables using constants, enums, and random numbers.

The final sections are about working with code using switches so that you don’t have to keep creating huge if…else if statement chains. You also gain knowledge ...

Get C++ All-in-One For Dummies, 4th 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.