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?