作者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