Go to Post Remember, there are many differents path to obtaining knowledge. There's no need to pigeonhole the process. - Karthik [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2009, 15:23
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Modifying .CPP files

I would create a class like such:
Code:
class OurRobotDrive:private RobotDrive
{
public:
void ourFunction(int speed)
{
...
}
}
and you can still have the other functions!
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #2   Spotlight this post!  
Unread 15-02-2009, 00:40
TimCraig TimCraig is offline
Registered User
AKA: Tim Craig
no team
 
Join Date: Aug 2004
Rookie Year: 2003
Location: San Jose, CA
Posts: 221
TimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to behold
Re: Modifying .CPP files

Quote:
Originally Posted by byteit101 View Post
I would create a class like such:
Code:
class OurRobotDrive:private RobotDrive
{
public:
void ourFunction(int speed)
{
...
}
}
and you can still have the other functions!
Generally, if you want all the public members in the base class visible for the "is-a" relationship, you would use public inheritance. You don't see private inheritance used much.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-02-2009, 22:24
xtreampb's Avatar
xtreampb xtreampb is offline
Lead Programmer 2642
FRC #2642 (Pitt Pirates)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Snow Hill
Posts: 21
xtreampb is an unknown quantity at this point
Send a message via AIM to xtreampb Send a message via Yahoo to xtreampb
Re: Modifying .CPP files

ok thanks for all of yall's help. I built my class and have implemented it into the code, unfortuanatly i wasn't able to test the code before we had to ship it off but i have ran into an error with my deconstructor

Code:
error: declaration of 'Our_Drive::~Our_Drive()' outside of class is not definition
i dont have an error about the deconstructor in my header file, just in the CPP file. how do i fix this?
__________________
~Xtreampb~

Pitt Pirates 2642

Lead Programmer
Reply With Quote
  #4   Spotlight this post!  
Unread 26-02-2009, 22:30
xtreampb's Avatar
xtreampb xtreampb is offline
Lead Programmer 2642
FRC #2642 (Pitt Pirates)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Snow Hill
Posts: 21
xtreampb is an unknown quantity at this point
Send a message via AIM to xtreampb Send a message via Yahoo to xtreampb
Re: Modifying .CPP files

i fixed it, i had placed a simi colon after my function declaration, a rookie mistake
__________________
~Xtreampb~

Pitt Pirates 2642

Lead Programmer
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Location of WPI Library cpp files attached to Windriver marccenter C/C++ 5 11-02-2009 12:47
Bug (?) in Target.cpp in TwoColorTrackingDemo Mike Mahar C/C++ 0 02-02-2009 09:48
Need Help Locating .h and .cpp files jkjohnson Programming 0 30-01-2009 09:00
NiVision.cpp nickmagus Programming 4 26-01-2009 08:55
CAD Help needed. Mech Desktop 6 files backwards to AutoCAD 14? (2d files) Elgin Clock Inventor 0 30-08-2004 23:06


All times are GMT -5. The time now is 13:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi