I know that if you do:
In both cases, TestClass' empty constructor is called. But I want to declare that a class has that variable but not call the constructor until the owning class' constructor is called.Code:TestClass c; TestClass c = NULL;
Example:
How would I do this (i.e. keep "t" from being initialized)?Code:class Owner { protected: //Want this but not initialized! TestClass t; public: Owner() { t = TestClass(); } Owner(string name) { t = TestClass( name ); } };