Mail Archives: djgpp/1992/09/30/08:53:56
You may either have two different abs's one for the int, one for the float
case or you write a macro which takes care of what you want.
Hint: GNU C has 'typeof'which might help - I don't know.
Anyway, in C there is no automatic type conversion like in e.g. fortran.
You always take care of it by yourself using casts.
In C++ you might write a general class Number, which has subclasses Integer
and Float. I think this is not what you want.
--Chris
- Raw text -