Programming Language

C++ Study Note 1: const

1. const A variable or an object declared by keyword const is not motifiable. 2. Roles (1) Declare a constant variable const int LENGTH = 20; (2) Type checking const variable is commonly confused with #define micro, however, they are technically different. The constant variable declared by const is typed, so it can be type-checked by compiler through static type checking. But the micro defined by #define is a typeless placeholder.