083-C++
来源:互联网 发布:spss19.0破解软件 编辑:程序博客网 时间:2024/05/16 12:55
C++数据抽象
#include <iostream>using namespace std; class Adder{ public: // 构造函数 Adder(int i = 0) { total = i; } // 对外的接口 void addNum(int number) { total += number; } // 对外的接口 int getTotal() { return total; }; private: // 对外隐藏的数据 int total;};int main( ){ Adder a; a.addNum(10); a.addNum(20); a.addNum(30); cout << "Total " << a.getTotal() <<endl; return 0;}
阅读全文
0 0
- c
- c
- c
- c
- C
- c
- c
- c
- C+
- c
- C
- c
- c
- c
- C
- C
- c
- C
- eclipse签名打包时提示Certificate is expired
- android项目架构 -----Android 知识体系与常用第三方框架
- oracle数据库定时任务dbms_job的用法详解
- 并行计算
- 动态查找表之二叉排序树的查找、遍历、删除
- 083-C++
- 【总结】explicit关键字的用法
- 判断checkbox是否选择并且弹出选择的值
- JVM调优总结(2):基本垃圾回收算法
- PCIe TPH analysis
- 矩阵奇异值分解(SVD)及其应用
- Myeclipse中 Hibernate的设置
- Swift中如何管理内存?
- [HDU-5978] [Problem H]概率,找规律,简单博弈,水题(16大连站)