Class to construct instances of another class help

I currently have 2 classes: CBulb and CSwitch. They both have their own definitions and declarations in their own .h and .cpp files.

I am trying to create a 3rd class: CLamp that will have member variables as instances of CBulb and Cswitch.

I am having troubling writing the code for the CLamp Constructor CLamp(int x)
I need the CLamp Constructor to initalize both CBulb,and CSwitch objects.
I think the use of inheritance is needed. I've tried searching around and still am unable to figure it out.

If I can get the constructor working, I can probably get the CLamp member functions which affect the other 2 classes working. Please help.
Topic archived. No new replies allowed.