析构函数,构造函数
来源:互联网 发布:腾讯游戏竞技平台mac 编辑:程序博客网 时间:2024/05/01 22:48
#include<iostream.h>class test{int a,b;public:test(int x,int y){a=x;b=y;cout<<"调用构造函数test()"<<endl;}void print(){cout<<"两数相减得"<<a-b<<endl; }~test(){cout<<"调用析构函数test()"<<endl;}};void main(){int a1,b1;cout<<"请输入两个数"<<endl;cin>>a1>>b1;test t(a1,b1);t.print();}
0 0
- 构造函数,拷贝构造函数,赋值函数,析构函数
- 构造函数,拷贝构造函数,赋值函数,析构函数
- 构造函数、析构函数、拷贝构造函数,常函数
- 构造函数、析构函数、拷贝构造函数、赋值函数
- 构造函数,析构函数
- 构造函数,析构函数
- 构造函数+析构函数
- 构造函数/析构函数
- 构造函数 & 析构函数
- 构造函数 析构函数
- 析构函数,构造函数
- 构造函数、析构函数
- 构造函数,析构函数
- 构造函数,析构函数
- 构造函数,析构函数
- 函数 - 构造函数 - 析构函数
- 构造函数、析构函数、虚函数
- 虚函数/构造函数/析构函数
- Kali-Linux 2.0 安装中文输入法
- 乌鸦喝水
- 统计一个班的成绩
- 技术揭秘12306改造(一):尖峰日PV值297亿下可每秒出票1032张
- mysql外键(FOREIGN KEY)的简单使用
- 析构函数,构造函数
- 在一个字符串中找出java出现了几次
- jsp无法取到cookie问题及解决
- BigPipe学习研究
- 如何显示 word 左侧目录大纲
- hdu 5656 递推
- ARM Linux设备树
- 结构型模式之适配器模式
- maven之可视化项目依赖(Visualizing dependencies)