Re: [閒聊] VOID POINTER OPERATOR

看板EE_DSnP作者 (エニシ 縁)時間16年前 (2009/12/29 18:47), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串3/3 (看更多)
似乎還有這樣子的用法... #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)

12/30 00:34, , 1F
以此類推....?
12/30 00:34, 1F
文章代碼(AID): #1BETudRi (EE_DSnP)
文章代碼(AID): #1BETudRi (EE_DSnP)