|
Hallo Frank,
yes, it helped, thanks. But I still don't understand the background.
Normally, in c++ you can initialize your private components in the body
of the constructor or with a initialization list, like in your
suggestion.
Reagards.
Michael
Frank Passek wrote:
>
> Hi Michael,
>
> if you want to use a declarator list in the constructor you have to use
> the following syntax:
>
> /******* Implementation of the constructor *********/
> LightSensorHead::LightSensorHead( const Motor::Port motorport,
> const Sensor::Port lsensorport,
> const Sensor::Port rsensorport)
> : motor(motorport), lsensor(lsensorport), rsensor(rsensorport)
> {
> }
>
> Hope this helps.
>
> Best Regards
> Frank
|
|
Message is in Reply To:
| | Re: c++, classes
|
| Hi Michael, if you want to use a declarator list in the constructor you have to use the following syntax: /******* Implementation of the constructor ***...***/ LightSensorHead::Lig...ensorHead( const Motor::Port motorport, const Sensor::Port (...) (24 years ago, 5-Apr-01, to lugnet.robotics.rcx.legos)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|