OOP issue

I have the next classes: Engine, ElectricMotor, IgnitionSystem1, IgnitionSystem2;

the ignitionSystems' constructor is IgnitionSystem(Engine&, ElectricMotor&).

Next, I have a class Car
1
2
3
4
5
6
7
8
9
10
class Car
{ 
Engine engine;
ElectricMotor electricMotor;
IgnitionSystem1 is1(&engine, &electricMotor); // I want this to make an ignition system that uses the engine and the el.motor of the class.
IgnitionSystem2 is2(&engine, &electricMotor);

public:
functions........
}

i get syntax errors saying that & is wrong (inside the constructor) and when I am using is1 and is2 the compiler says that they must have class/struct/union(error c2228). how should I solve this?


Last edited on
Topic archived. No new replies allowed.