Where are MIN and MAX defined in C, if at all?
MIN
MAX
What is the best way to implement these, as generically and type safely as possible? (Compil
I know the guy said "C"... But if you have the chance, use a C++ template:
template T min(T a, T b) { return a < b ? a : b; }
Type safe, and no problems with the ++ mentioned in other comments.