http://blog.csdn.net/lifengguo_njupt/article/details/7992332
C + + can define constants with const, or you can define constants using # define, but the former has more advantages than the latter:
1,const constants have data types, and macro constants do not have data types, and the compiler can perform static type security checks on the former, but only character substitution, no type safety checks, and unexpected errors in character substitution (marginal effect)
2, some integrated debugging tools can debug const constants, but cannot debug macro constants.
Therefore, you should use const to define symbolic constants, including string constants, in C + + as much as possible.
Things that are modified by const are protected by the static type security mechanism implemented by C++/C language, which can prevent accidental modification and improve the robustness of the program.
The difference between a const constant and a # define macro constant