constructor and copy constructor
-
i'm not sure of the output, but the first thing i see is that you derive A and its destructor (
A::~A()
) is not declared asvirtual
... i think so the output is:A::A()
A::A()
B::B()
A::~A()
A::~A()is is wrong ? (i did not compile to test, so i may have written an error, but that was the game, wasn't it ? :-D )
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
bobi_zcl wrote: what is the output result?why? Why don't you step through it yourself and find out? :^) Note that the code in
main()
won't work on VC7.x, the declarations ofa
andb
will be treated as function prototypes, not variable declarations. If you use 7.x you'll need to change it to:A a = A();
A b = B();--Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD