View Single Post
  #2   Spotlight this post!  
Unread 22-01-2013, 17:13
MetalJacket's Avatar
MetalJacket MetalJacket is offline
Has read the 2014 manual
AKA: Jesse Gibson
FRC #2068 (The Metal Jackets)
Team Role: CAD
 
Join Date: Oct 2012
Rookie Year: 2011
Location: Virginia
Posts: 164
MetalJacket has a spectacular aura aboutMetalJacket has a spectacular aura aboutMetalJacket has a spectacular aura about
Re: Craziest Bug I'v Ever Seen--C++

Try declaring it as
Code:
RobotDrive *myRobot = new RobotDrive( 1, 2, 3, 4 );
// this creates a pointer to the object's memory location
or
Code:
RobotDrive myRobot( 1, 2, 3, 4 );
If you use the first one and it works, whenever you use any of the object's member functions, you will have to type
Code:
myRobot->TankDrive( /* arguments */ );
as opposed to
Code:
myRobot.TankDrive( /* arguments */ );
which will work for the second version
__________________
Team Role = !artTeam
2011 - Logomotion
- Virginia Regional : Tournament Semi-Finalist, Gracious Professionalism Award
2012 - Rebound Rumble
- Chesapeake Regional : Tournament Finalist, Gracious Professionalism Award
2013 - Ultimate Ascent
- Virginia Regional : Gracious Professionalism Award

Last edited by MetalJacket : 22-01-2013 at 17:17.