Summary

In this hour you learned about the built-in C++ types, such as char, bool, int and float. You also learned about numeric and character variables and constants.

You must declare a variable before it can be used, and then you must store the type of data that you've declared correct for that variable. If you put too large a number into an integral variable, it produces an incorrect result.

This chapter also reviewed literal and symbolic constants, as well as enumerated constants, and showed two ways to declare a symbolic constant: using #define and using the keyword const.

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.