The read-only variables defined by const only provide the corresponding memory address from the Assembly perspective, rather than the immediate number as defined by define. Therefore, the read-only variables defined by const areProgramThere is only one copy during the running process (because it is a global read-only variable stored in the static zone) the macro variables defined by define have several copies in the memory. The define macro is replaced during the pre-compilation phase, while the read-only variables modified by const are determined that the value of define macro has no type during compilation. read-Only variables modified by const have specific types.
In the generated execution program:
Define occupiesCodeSegment space and pre-processing time while const occupies global storage space
The read-only variable modified by const cannot be used as the dimension of the defined array, nor can it be placed behind the case keyword.