Skip to main content

Arrays and enum

  • Chapter
  • First Online:
C++ for Lazy Programmers
  • 4524 Accesses

Abstract

In this chapter, sequences (arrays) of values, enumeration types, weather data, and board games are discussed.

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 34.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.

    Omit the = if you like: double Numbers[] {0.1, 2.2, 0.5, 0.75};.

  2. 2.

    “Zero initialization.” If the members of your array are of a type that has 0 (or 0.0!), they’ll be set to that.

  3. 3.

    In this illustration, I write the addresses in “hexadecimal,” that is, base 16, which is conventional. The reason it goes up by 4 each row is that I’m assuming int takes up 4 memory locations, that is, 4 “bytes.” None of this matters here, but I don’t want the C++ gods to laugh at my diagram.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Will Briggs

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Briggs, W. (2019). Arrays and enum. In: C++ for Lazy Programmers. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5187-4_10

Download citation

Publish with us

Policies and ethics