F
fighter1
Hello,
I have a question about passing an object into a constructor.
How can I check to make sure that the object is good/valid that is
being passed into the constructor.
Obviously I could check to see if it is non-NULL, but that still will
not necessarily tell me anything.
For example:
/* here is a constructor car that takes an engine class as an
argument. But, I better check to make sure that engine is valid
so how do I do that?
*/
Car::Car( Engine* engine )
{
// check to make sure that engine is valid.
}
Thanks in advance for any help,
John
I have a question about passing an object into a constructor.
How can I check to make sure that the object is good/valid that is
being passed into the constructor.
Obviously I could check to see if it is non-NULL, but that still will
not necessarily tell me anything.
For example:
/* here is a constructor car that takes an engine class as an
argument. But, I better check to make sure that engine is valid
so how do I do that?
*/
Car::Car( Engine* engine )
{
// check to make sure that engine is valid.
}
Thanks in advance for any help,
John