C++ calling a constuctor

Started by
23 comments, last by daher 20 years, 9 months ago
Best damn description of the matter I've seen so far. Why didn't you say that the first time I asked?

[edited by - Red Ant on July 7, 2003 10:58:02 AM]
Advertisement
There isn''t? o.0
I''m pretty sure that I wrote some code that did
CFoo::CFoo( int ) {    CFoo();} 
Read the thread through again, and read this thread:
Clicky

If you still don't understand why, then ask again, but I think the question has been answered.

[edited by - jamessharpe on July 7, 2003 11:39:43 AM]
quote:Original post by Anonymous Poster
I know this does not apply to the examples used earlier, but using Inheritence\Multiple Inheritence, you can call the Base Class constructor whithin the Derived Class Constructor, so is it just me or does that throw out your There is NO way to call another constructor from whithin another one in C++?

No. In that case, you are not calling a ctor, you are specifying a base class initialisation.
Yeah a constructor will be called always in inheritance, even if it is a compiler made default one. C++ just gives you the option of controlling which constructor gets called - and the arguments it''s called with.

This topic is closed to new replies.

Advertisement