Go to Post So basically, the advantage of #35 is that it allows you to be sloppier in your design and fabrication. If you pay close attention to these details, you will never have a problem with #25 chain. - Jim Zondag [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 30-12-2004, 19:03
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Overloaded functions

In my header file, I have the following function prototypes:

Code:
int abs(int);
float abs(float);
In my source file, I have the following functions:

Code:
int abs(int x)
{
  if(x>=0)
    return x;
  else
    return -x;
}

float abs(float x)
{
  if(x>=0)
    return x;
  else
    return -x;
}
I also have a whole bunch of other overloaded functions. (I know this isn't the best example, but it's short.) However, when I compile it, I get a lot of "type mismatch in redeclaration of 'abs'" and "redefinition of 'abs'" errors. Does the C18 compiler not support overloading, or am I doing something wrong that I'm overlooking?
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
 


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
New Serial Port Driver Kevin Watson Programming 16 09-01-2005 01:56
Trigometric Functions cibressus53 Programming 4 25-10-2004 21:49
Do you write functions for your code? Max Lobovsky Programming 26 11-03-2004 07:04
Important functions of a first robot? Ianworld General Forum 5 15-04-2003 13:29
Primary Functions Poll Ben Mitchell Rules/Strategy 1 16-02-2003 02:10


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

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