Another Native Data Type

We've used almost all the native data types, but there is one other native type that you might see in other programs and in other textbooks, so I should tell you about it now. By the way, I haven't avoided this type because it's particularly difficult to use; the reason is simply that it wasn't necessary to the task at hand, which was teaching you how to program, using C++. Now that we have accomplished that task, you might as well add it to your arsenal of tools. This other native type is float, which, like the double type we've already seen, is used to store values that can contain fractional parts, (so-called floating-point numbers). Why are there two of these types rather than only one? The main difference between ...

Get Learning to Program in C++ 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.