August 2001
Beginner
482 pages
10h 52m
English
Like variables, constants are data storage locations. But variables can vary; constants, on the other hand and as you might have guessed, do not vary. |
You must initialize a constant when you create it, and you cannot assign a new value later; after a constant is initialized, its value is, in a word, constant.
C++ has two types of constants: literal and symbolic. |
A literal constant is a value typed directly into your program wherever it is needed. For example:
int myAge = 39;
myAge is a variable, of type int; 39 is ...
Read now
Unlock full access