|
Re: Programming Help!
Good catch on the constructors. Actually though, I think the whole lines for the Carriage motor and elevator motor before the "{" braces should be taken out. Since those are declared as pointers, you use the "name = new ClassName(args);" format in the actual constructor, which you were doing, but then commented out.
If you declared the objects as actual objects instead of as pointers (i.e. Victor Elevator_motor; Victor Arm_motor; instead of Victor *Elevator_motor; Victor *Arm_motor; ) then you would use the format described by MattD.
As always, I'm only a fallible student, so someone feel free to disprove me.
Last edited by CodeMonkeyMatt : 24-02-2011 at 00:42.
Reason: Syntax turned into smile
|