Lesson 3. Using Variables, Declaring Constants

Variables are tools that help the programmer temporarily store data for a finite amount of time. Constants are tools that help the programmer define artifacts that are not allowed to change.

In this lesson, you find out

• How to use C++11 keywords auto and constexpr

• How to declare and define variables and constants

• How to assign values to variables and manipulate those values

• How to write the value of a variable to the screen

What Is a Variable?

Before you actually explore the need and use of variables in a programming language, take a step back and first see what a computer contains and how it works.

Memory and Addressing in Brief

All computers, smart phones, and other programmable devices ...

Get Sams Teach Yourself C++ in One Hour a Day, Seventh 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.