- 3
- 0
- 约5.02千字
- 约 24页
- 2020-03-26 发布于湖南
- 举报
String 对象计数 计数为何失败? 程序为何出错? Count: 2 Count: 3 Count: 4 PS 4...deleted Passed by Ref: Hello c++ -- 1 Count: 3 Passed by copy: Hello c++ -- 1 Hello c++ -- 1...deleted Count: 2 s3...deleted Hello c++ -- 2...deleted ?V a?V a+ -- 1...deleted Aborted (core dumped) * 西安交通大学 * 西安交通大学 * 西安交通大学 * 西安交通大学 西安交通大学 西安交通大学 西安交通大学 西安交通大学 现场演示之 再次把 const 成员函数讲讲。 写成员函数时,许多程序员忘记了 this (我)的存在。 讲过一次了;重温 讲过,重温 为什么使用 static 数据成员?因为大家的账户的利率都一样。没有必要每个账户都有个rate。 main() 之前初始化 类名::静态成员 – best 静态成员属于类。不属于某个对象。 演示。 修改 delete ,使得没有错误core dump。 6 类的静态成员
原创力文档

文档评论(0)