看板 C_and_CPP 關於我們 聯絡資訊
class 可以當成structure使用 所以 cubic cubic_sum(cubic object) 意思跟 int int_sun(int value) 是一樣的 至於this就很簡單了 a是cubic所宣告的變數 this->a就是a變數 沒有this->不加也可以用 this->等於(*this). 所以說this就是此物件的指標 以上是憑經驗打的 有錯誤請指正 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.42.121.131