c++中const用法总结(Summary of const usage in c++).docVIP

  • 5
  • 0
  • 约5.58千字
  • 约 6页
  • 2017-08-17 发布于河南
  • 举报

c++中const用法总结(Summary of const usage in c++).doc

c中const用法总结(Summaryofconstusageinc)

c++中const用法总结(Summary of const usage in c++) Summary of const usage in C++ 1. const constants, such as const, int, max = 100; Advantages: const constants have data types, and macro constants have no data type. The compiler can perform a type security check on the former, while the latter only performs character substitution, there is no type of security check, and unexpected errors may occur when the characters are replaced. 2. const modified class data members. Const data members are constants only in the lifetime of an object, and are mutable for the entire class. Because classes can create

文档评论(0)

1亿VIP精品文档

相关文档