O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

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

Types of Variables and Valid Names

Integers come in two varieties: signed and unsigned. The idea here is that sometimes you need negative numbers, and sometimes you don't. Integers (short and long) that aren't labeled unsigned are assumed to be signed. signed integers are either negative or positive. unsigned integers are always positive.

Use int for Number Variables

For most programs, most of the time, you can simply declare your simple number variables as ints—these are signed integers.

Non-Integer Variable Types

Several variable types are built into C++. They can be conveniently divided into integer variables (the type discussed so far), character ...

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