Click here to Skip to main content
15,912,082 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: iostream.h in Visual Studio 2005 Pin
Michael Dunn1-Aug-06 19:37
sitebuilderMichael Dunn1-Aug-06 19:37 
QuestionDebug runs, Release crashes. Why? Pin
Hotte1-Aug-06 5:14
Hotte1-Aug-06 5:14 
AnswerRe: Debug runs, Release crashes. Why? Pin
toxcct1-Aug-06 5:20
toxcct1-Aug-06 5:20 
QuestionRe: Debug runs, Release crashes. Why? Pin
David Crow1-Aug-06 5:45
David Crow1-Aug-06 5:45 
AnswerRe: Debug runs, Release crashes. Why? Pin
Zac Howland1-Aug-06 5:56
Zac Howland1-Aug-06 5:56 
QuestionSir, Why Virtual Constructor doesn't exist ? Whereas we have virtual Destructor. Pin
CodeVarma1-Aug-06 4:40
CodeVarma1-Aug-06 4:40 
AnswerRe: Sir, Why Virtual Constructor doesn't exist ? Whereas we have virtual Destructor. Pin
toxcct1-Aug-06 4:45
toxcct1-Aug-06 4:45 
GeneralRe: Sir, Why Virtual Constructor doesn't exist ? Whereas we have virtual Destructor. Pin
Zac Howland1-Aug-06 4:55
Zac Howland1-Aug-06 4:55 
toxcct wrote:
on the other side, destructors should always be virtual


Not always, just any time you are writing a class that is meant (or allows for) a class to be derived from it. The STL containers do not have virtual destructors because they are not meant to be base classes.

Basically, any time you have a virtual function in your class, you should declare your destructor as virtual.

As for the OP ... the way constructors work does not provide a need for virutal constructors. When an object is created, its allocation is started from the most base class and then works down towards the desired derived class. In other words, if you have a heirarchy where A is derived from B is derived from C, and you declare a variable of type A, the constructor for C is called, then B, and finally A.

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

GeneralRe: Sir, Why Virtual Constructor doesn't exist ? Whereas we have virtual Destructor. Pin
toxcct1-Aug-06 4:59
toxcct1-Aug-06 4:59 
GeneralRe: Sir, Why Virtual Constructor doesn't exist ? Whereas we have virtual Destructor. Pin
Zac Howland1-Aug-06 5:11
Zac Howland1-Aug-06 5:11 
AnswerRe: Sir, Why Virtual Constructor doesn't exist ? Whereas we have virtual Destructor. Pin
Warren Stevens1-Aug-06 5:13
Warren Stevens1-Aug-06 5:13 
GeneralRe: Sir, Why Virtual Constructor doesn't exist ? Whereas we have virtual Destructor. Pin
toxcct1-Aug-06 5:19
toxcct1-Aug-06 5:19 
GeneralRe: Sir, Why Virtual Constructor doesn't exist ? Whereas we have virtual Destructor. Pin
Zac Howland1-Aug-06 5:23
Zac Howland1-Aug-06 5:23 
AnswerRe: Sir, Why Virtual Constructor doesn't exist ? Whereas we have virtual Destructor. Pin
David Crow1-Aug-06 4:56
David Crow1-Aug-06 4:56 
QuestionTab Control using 'CTabCtrl'? Pin
Andy Rama1-Aug-06 4:39
Andy Rama1-Aug-06 4:39 
AnswerRe: Tab Control using 'CTabCtrl'? Pin
Hamid_RT1-Aug-06 4:53
Hamid_RT1-Aug-06 4:53 
GeneralRe: Tab Control using 'CTabCtrl'? Pin
Andy Rama1-Aug-06 20:32
Andy Rama1-Aug-06 20:32 
GeneralRe: Tab Control using 'CTabCtrl'? Pin
Hamid_RT2-Aug-06 9:29
Hamid_RT2-Aug-06 9:29 
GeneralRe: Tab Control using 'CTabCtrl'? Pin
Andy Rama2-Aug-06 21:04
Andy Rama2-Aug-06 21:04 
GeneralRe: Tab Control using 'CTabCtrl'? Pin
Hamid_RT2-Aug-06 22:01
Hamid_RT2-Aug-06 22:01 
GeneralRe: Tab Control using 'CTabCtrl'? Pin
Andy Rama2-Aug-06 23:11
Andy Rama2-Aug-06 23:11 
GeneralRe: Tab Control using 'CTabCtrl'? Pin
Hamid_RT3-Aug-06 0:52
Hamid_RT3-Aug-06 0:52 
Questionhow to convert a word file to text file Pin
georgekjolly1-Aug-06 4:38
georgekjolly1-Aug-06 4:38 
AnswerRe: how to convert a word file to text file Pin
toxcct1-Aug-06 4:39
toxcct1-Aug-06 4:39 
AnswerRe: how to convert a word file to text file Pin
David Crow1-Aug-06 4:51
David Crow1-Aug-06 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.