SimCenter Training > Programming Bootcamp
Constructor and Destructor types
(1/1)
faisal:
What is null constructor and full constructor? Can we have different types of constructors? When shall we use them in recommended way?
Followup question: Can we have a virtual destructor in the interface .h file like:
--- Code: ---//destructor
virtual ~Someclass( ) ;
--- End code ---
I can refer to some code examples if required.
fmk:
a null constructor has 0 arguments, others have a number of arguments. a single class can have multiple constructors that take different types and numbers of arguments.
you can .. you only need the virtual destructors if you are envisioing a subclass
Navigation
[0] Message Index
Go to full version