第4章类的特殊函数与成员.ppt.ppt

第4章类的特殊函数与成员.ppt.ppt

class CNetComputer { static int numberLoggedOn; public: CNetComputer() { char response; cout Do you want to log onto NetWord?(y/n)endl; cin response; if(response == y) numberLoggedOn++; } ~CNetComputer() { numberLoggedOn--; } static void ShowNumber() { cout number … = numberLoggedOn endl; } void ShowAddress() { cout “Address of … = numberLoggedOn endl; } };;4.1 网络登录计数器;*;*;*;*;*;*;*;*;*;*;静态成员函数与 普通成员函数的区别;说明 教材4.1.2~4.1.3节的例题 不需要看;*;*;*;*;*;*;*;*;*;复习

文档评论(0)

1亿VIP精品文档

相关文档