作者herbert570 (エニシ 縁)
看板EE_DSnP
标题Re: [闲聊] VOID POINTER OPERATOR
时间Tue Dec 29 18:47:01 2009
似乎还有这样子的用法...
#include <iostream>
#include <vector>
#include "header.h"
using namespace std;
class test{
public:
operator int(){
return 4;
}
};
int main(){
test b;
cout << (int) b << endl;
cout << "hello world!\n";
return 0;
}
---
结果如下
---
4
hello world!
---
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.4.187
※ 编辑: herbert570 来自: 140.112.4.187 (12/29 18:51)
1F:推 hfslyc:以此类推....? 12/30 00:34