Connecting Tech Pros Worldwide Help | Site Map

Which destructor is called in which sequence at the end of the main program?

 
LinkBack Thread Tools Search this Thread
  #1  
Old December 21st, 2007, 05:55 AM
Mark Sullivan
Guest
 
Posts: n/a
Default Which destructor is called in which sequence at the end of the main program?

Assume I have the following code structure:

class A .... { ..... }


class B .... { .... }

main () {

A a;
B b;

.....

}

Both objcts a and b are created at the beginning.

But when the main program reaches the end which destructor is called first:

~A()

or

~B()

?
Mark


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.