Zebra0.com

cpp variablesC++ Variables: type

C++ Variables: type

C++ Variables: type

Before a variable can be used, it must be declared. To declare a variable, first decide what type of information you want to store.

Type

Whole numbers, number with no decimal places are called integers.
Numbers with decimal places and very large numbers are called double.
Single letters such as ‘Y’ or ‘N’ are characters.
Words, such as “Hello”, or a persons name are called strings.
Variables that can only have the values true or false are called Boolean.
Strings are somewhat more complicated because they require an array of memory locations. Strings are discussed in another lesson.
Drill on type