O'Reilly logo

Sams Teach Yourself C++ in One Hour a Day, Seventh Edition by Siddhartha Rao

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required