1. 首页
  2. 数据库
  3. 其它
  4. C++ 类型转换运算符

C++ 类型转换运算符

上传者: 2020-12-31 15:41:45上传 PDF文件 37.36KB 热度 17次
#include using namespace std; class SmallInt { public: /** * implicit constructor * 实现int类型转换为SamllInt类型 */ SmallInt(const int val): value(val) { cout << "SmallInt(const int val)" << endl; } /** * class-type conversion * 无显式返回类型 * 无形参 * 必须定义成类的成员函数 * 一般被定义成co
下载地址
用户评论