2013年2月23日

c++ static类成员

摘要: 使用类的static成员的优点:(1)static成员在类的作用域中,避免与其他作用域的名字冲突。(2)可以实施封装。static成员可以是私有成员,它遵循正常的公有、私有访问规则。(3)static成员与特定类关联,更能清晰的显示出程序的意图。class Account{public: // interface functions here void applyint() { amount += amount * interestRate; } static double rate() { return interestRate; } static void rate... 阅读全文

posted @ 2013-02-23 12:01 zhuyf87 阅读(279) 评论(0) 推荐(0) 编辑

导航