|
class MOTOR {
public:
MOTOR(float temp = 0, uint16_t rpm = 0) : Temp (temp), Rpm(rpm) {} // Конструкторfloat Temp;
uint15_t Rpm;
};
class BMW
{
public:
BMW (MOTOR *motor) : motor_bmw(motor) {}
~BMW() { delete motor_bmw; }MOTOR *motor_bmw;
}
BMW *bmw325ix;void main (void) {
MOTOR *motor = new MOTOR(20); // initial temp = 20'C
bmw325ix = new BMW(motor);
...
}
E-mail: info@telesys.ru