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?
Hm… that’s unfortunate. Is there any way to get the equivalent of overloading, without making two separately named functions? I guess this is what happens when a TI-BASIC/C++/Java programmer tries to do C.
Well for this example, you could easily just cast to int and use the same function. (You could cast to int in all cases, even when it already is an int, to maintain uniformity). I can’t really think of any other way.