Re: 請問C++的物件誕生與死亡

看板Programming作者時間18年前 (2008/02/03 14:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
※ 引述《quota@kkcity.com.tw (大改名片檔)》之銘言: > 請問我可以利用以下方式產生box1這一個物件 > class CBox > { > public: > double length; > double breadth; > double height; > }; > int main() { > CBox box1; > 那請問可以在程式進行中讓這個物件死亡嗎? > 謝謝 int main() { CBox *box1 = new CBox(); //出生 ... delete box1; //死亡 ... } -- ※ Origin: SayYA 資訊站 <bbs.sayya.org> ◆ From: 59-104-128-156.adsl.dynamic.seed.net.tw
文章代碼(AID): #17fL_Z00 (Programming)
文章代碼(AID): #17fL_Z00 (Programming)