Possible duplicate:
function overload in C
ANSI C does not allow function overloading (I'm not sure about C99).
eg:
char max(char x, char y); short max(short x, short y); int max(int x, int y); float max(float x, float y);
is not valid ANSI C source code.
What technique (or idea) should be used for the problem of function overloading in ANSI C?
Note
The answer renames the functions, but which template should be used to rename, these function names remain the "good function name" ?
eg:
char max1(char x, char y); short max2(short x, short y); int max3(int x, int y); float max4(float x, float y);
is not a good name for max
function name.
source share