<<< C++ variables | Index | Variable Names >>> |
Declaration initializer is an optional part of the variable declaration.
Initializer provides initial value to our variables:
int counter = 1000; const double pi = 3.14;
Note: const transforms a variable into a constant value...
...once initialized, const variable can never change again.
Declaration initializer is the only way to set value of a const variable.
<<< C++ variables | Index | Variable Names >>> |