Skip to main content

Introducing Fundamental Types of Data

  • Chapter
  • First Online:
Beginning C++20
  • 3184 Accesses

Abstract

In this chapter, we’ll explain the fundamental data types that are built into C++. You’ll need these in every program. All of the object-oriented capabilities are founded on these fundamental data types because all the data types that you create are ultimately defined in terms of the basic numerical data your computer works with. By the end of the chapter, you’ll be able to write a simple C++ program of the traditional form: input – process – output.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

     If need be, you can determine whether char is signed or not for your compiler using the constant std::numeric_limits<char>::is_signed in the <limits> module. We’ll have more to say about the <limits> module later in this chapter.

  2. 2.

     These are examples of variable templates, a lesser-used flavor of templates. The principle is the same as with the function and class templates we explain in Chapters 10 and 17.

  3. 3.

     Not all doubles will be formatted using 16 digits, though. The default formatting of the double value 1.5, for instance, would just be ”1.5”.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Ivor Horton and Peter Van Weert

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Horton, I., Van Weert, P. (2020). Introducing Fundamental Types of Data. In: Beginning C++20. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5884-2_2

Download citation

Publish with us

Policies and ethics