2014年4月15日

C++ const用法 尽可能使用const

摘要: C++const 允许指定一个语义约束,编译器会强制实施这个约束,允许程序员告诉编译器某值是保持不变的。如果在编程中确实有某个值保持不变,就应该明确使用const,这样可以获得编译器的帮助。1.const 修饰成员变量 1 #include 2 using namespace std; 3 in... 阅读全文

posted @ 2014-04-15 09:21 旭东的博客 阅读(183376) 评论(7) 推荐(26)

导航