Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Related to sequence of call of destructor

This is a discussion on Related to sequence of call of destructor within the C and C++ forums, part of the Software Development category; Hi to all, i have a question. If class c derived from class a and class b also. Then while deleting object of class c which one is called first ...

Go Back   Geeks Talk > Software Development > C and C++
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 06-25-2009
Junior Member
 
Join Date: Mar 2007
Location: India
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ashishsaryar is on a distinguished road
Related to sequence of call of destructor

Hi to all, i have a question. If class c derived from class a and class b also. Then while deleting object of class c which one is called first class a destructor or class b destructor? thanks
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-25-2009
Contributing Member
 
Join Date: Apr 2007
Location: Bangalore
Posts: 46
Thanks: 6
Thanked 8 Times in 7 Posts
prakash.kudrekar is on a distinguished road
Re: Related to sequence of call of destructor

Hi Ashish,

It depends on the sequence you mentioned while derving the class c.
for example:

class c:: pub A, pub B

then Destructor of A gets called first

and vise versa.

I hope its clear. let me know if i m wrong.
Reply With Quote
Reply

  Geeks Talk > Software Development > C and C++

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Call by Value and Call by Reference Lokesh M C and C++ 2 06-23-2009 03:29 AM
constructor & destructor Molugu Natraj C and C++ 6 05-10-2009 09:41 AM
constructor and destructor Sangeetha Poojary C and C++ 8 04-06-2009 01:47 PM
Can a structure in C++ have a Constructor and Destructor coolsomoo C and C++ 2 02-02-2009 07:45 AM
What comes next in this sequence? psuresh1982 Brainteasers 5 11-29-2006 01:45 AM


All times are GMT -4. The time now is 06:57 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved