Message-ID: <003201c13a3f$053b2f40$aa7ba8c0@fuego> From: "Gorden" To: References: Subject: Can You help me about djgpp with c++ Date: Tue, 11 Sep 2001 05:24:47 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Reply-To: djgpp AT delorie DOT com I Buy a book (Teach Yourself C++, 3rd Edition By Herbert Schildt) inside have a C++ smaple #include #include class samp { private: int i; public: samp(void) { cout << "constructor" << '\n'; } ~samp(void) { cout << "destructor " << '\n'; } void set(int n) { i = n ; } int get(void ) { return i; } }; int test(samp o) { return o.get() * o.get(); } void main(void) { clrscr(); samp o; o.set(10); cout << test(o) << '\n'; } The Book have result is constructor destructor 100 destructor in borland c++ 3.01 the result is constructor destructor 100 destructor But in djgpp the result is constructor destructor 100 destructor destructor Why in djgpp 3 times call destructor, I try compile on borland C++ 3.01 have 2 times call destructor Is djgpp or gpp error ??????????