View Single Post
  #5   Spotlight this post!  
Unread 24-02-2011, 00:41
CodeMonkeyMatt CodeMonkeyMatt is offline
Registered User
FRC #2605
 
Join Date: Jan 2011
Rookie Year: 2008
Location: WA
Posts: 46
CodeMonkeyMatt is on a distinguished road
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
Reply With Quote