討論串[問題] this 指標
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓2(2推 0噓 0→)留言2則,0人參與, 最新作者sarsenwen (超囧學生)時間15年前 (2009/06/06 21:17), 編輯資訊
0
0
0
內容預覽:
#include <iostream>. #include <cstdlib>. using namespace std;. class cubic \\定義cubic類別. {. private:. int a; \\宣告私用成員 a. public:. cubic(int n) \\設定一個立方
(還有558個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者feeya (24 August 升格為鄉民)時間15年前 (2009/06/06 22:45), 編輯資訊
0
0
0
內容預覽:
class 可以當成structure使用. 所以 cubic cubic_sum(cubic object). 意思跟 int int_sun(int value) 是一樣的. 至於this就很簡單了. a是cubic所宣告的變數. this->a就是a變數. 沒有this->不加也可以用. th
首頁
上一頁
1
下一頁
尾頁