推 gozha:constructor 03/17 00:16
推 miecowbai:PiggyBank(){total=0;}; 用建構者設定.. 03/17 00:17
→ eu7908:噢 我們還沒教到建構元= = 03/17 00:19
→ eu7908:請問有別的辦法嗎? 03/17 00:24
推 chrisdar:void total(int t){total=t;} 03/17 00:25
→ chrisdar:void set_total(int t){total=t;} 03/17 00:25
推 plover:自己寫 init(), allocate(), ... 03/17 01:04
→ softwind:還沒有教 constructor阿... 阿碼勒真天才... 03/17 01:14
→ legnaleurc:PiggyBank() : total( 0 ) {} 03/17 01:15
推 stonehomelaa:還沒教到 自己看書不就好了 又不難 03/17 11:18
推 Ebergies:PiggyBank piggybank; piggybank.total= 0; ... 03/17 11:30
推 kvykn:用member initialization list 謝謝 03/17 13:53
→ eu7908:我知道了 謝謝 03/18 18:55