Click here to Skip to main content
15,917,795 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: copy/past column from excel file to an other one Pin
David Crow27-Aug-08 8:14
David Crow27-Aug-08 8:14 
QuestionPreprocessor confusion Pin
s196675m27-Aug-08 6:42
s196675m27-Aug-08 6:42 
AnswerRe: Preprocessor confusion Pin
Mark Salsbery27-Aug-08 7:08
Mark Salsbery27-Aug-08 7:08 
AnswerRe: Preprocessor confusion Pin
Cedric Moonen27-Aug-08 7:40
Cedric Moonen27-Aug-08 7:40 
QuestionSO_RCVTIMEO not working for nonblocking win32 socket Pin
onlyjaypatel27-Aug-08 3:11
onlyjaypatel27-Aug-08 3:11 
AnswerRe: SO_RCVTIMEO not working for nonblocking win32 socket Pin
SandipG 27-Aug-08 3:32
SandipG 27-Aug-08 3:32 
QuestionInhertance Diamond problem Pin
laksh220427-Aug-08 2:41
laksh220427-Aug-08 2:41 
AnswerRe: Inhertance Diamond problem [modified] Pin
Nibu babu thomas27-Aug-08 2:48
Nibu babu thomas27-Aug-08 2:48 
laksh2204 wrote:
I am not able to understand that why the constructor of A is called again after B. Or why not the same is happening after constructor of C is called.


So the compiler goes likes this...

First time it sees "new D" it

1. calls constructor of D
2. which in turn calls constructor of B (Since B if the first base class)
3. which in turn calls constructor of A (Prints "A")
4. then (Prints "B")
5. then the compiler calls constructor of C (Second base class)
6. which in turn again calls constructor of A (Prints "A")
7. then (Prints "C")
8. in the end (Prints "D")

So bottom line is unless base class constructor code executes derived class
constructor doesn't execute.


Nibu babu thomas
Microsoft MVP for VC++


Code must be written to be read, not by the compiler, but by another human being.

Programming Blog: http://nibuthomas.wordpress.com

modified on Wednesday, August 27, 2008 8:58 AM

GeneralRe: Inhertance Diamond problem Pin
laksh220427-Aug-08 3:28
laksh220427-Aug-08 3:28 
GeneralRe: Inhertance Diamond problem Pin
Nibu babu thomas27-Aug-08 3:36
Nibu babu thomas27-Aug-08 3:36 
AnswerRe: Inhertance Diamond problem Pin
_AnsHUMAN_ 27-Aug-08 2:55
_AnsHUMAN_ 27-Aug-08 2:55 
AnswerRe: Inhertance Diamond problem Pin
Sarath C27-Aug-08 4:37
Sarath C27-Aug-08 4:37 
QuestionHow to run VB Script in MFC program? Pin
santhoshv8427-Aug-08 2:34
santhoshv8427-Aug-08 2:34 
AnswerRe: How to run VB Script in MFC program? Pin
Nibu babu thomas27-Aug-08 2:37
Nibu babu thomas27-Aug-08 2:37 
QuestionAdd EditControl Pin
MsmVc27-Aug-08 2:06
MsmVc27-Aug-08 2:06 
AnswerRe: Add EditControl Pin
Cedric Moonen27-Aug-08 2:11
Cedric Moonen27-Aug-08 2:11 
GeneralRe: Add EditControl Pin
MsmVc27-Aug-08 2:19
MsmVc27-Aug-08 2:19 
GeneralRe: Add EditControl Pin
Cedric Moonen27-Aug-08 2:38
Cedric Moonen27-Aug-08 2:38 
GeneralRe: Add EditControl Pin
David Crow27-Aug-08 3:06
David Crow27-Aug-08 3:06 
GeneralRe: Add EditControl Pin
Hamid_RT27-Aug-08 4:09
Hamid_RT27-Aug-08 4:09 
AnswerRe: Add EditControl Pin
Jijo.Raj27-Aug-08 2:15
Jijo.Raj27-Aug-08 2:15 
AnswerRe: Add EditControl Pin
Hamid_RT27-Aug-08 4:08
Hamid_RT27-Aug-08 4:08 
GeneralRe: Add EditControl Pin
MsmVc27-Aug-08 18:21
MsmVc27-Aug-08 18:21 
GeneralRe: Add EditControl Pin
MsmVc27-Aug-08 18:50
MsmVc27-Aug-08 18:50 
GeneralRe: Add EditControl Pin
Hamid_RT28-Aug-08 23:15
Hamid_RT28-Aug-08 23:15 

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.