main.cpp

来自「this a good book.」· C++ 代码 · 共 36 行

CPP
36
字号
#include<iostream.h>

class C0
{
public:
	C0(int t)
	{
		cout<<t<<endl;
	}
	/*******found******/
	int static operator int()
	{
		cout<<"C0 int"<<endl;
		/*******found******/
		return 0;
	}
};
class C1
{
public:
	operator C0()
	{
		cout<<"C1 C0"<<endl;
		/*******found******/
		
	}
};


int main()
{
	C1 obj;
	C0 obj2 = C0(obj);
	return obj2<<10;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?