SimCenter Forum

SimCenter Training => Programming Bootcamp => Topic started by: faisal on January 07, 2021, 03:23:14 PM

Title: Constructor and Destructor types
Post by: faisal on January 07, 2021, 03:23:14 PM
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: [Select]
//destructor
  virtual ~Someclass( ) ;

I can refer to some code examples if required.
Title: Re: Constructor and Destructor types
Post by: fmk on January 08, 2021, 04:48:52 PM
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