Re: [閒聊] VOID POINTER OPERATOR
似乎還有這樣子的用法...
#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
討論串 (同標題文章)
完整討論串 (本文為第 3 之 3 篇):