MIN and MAX in C

后端 未结 14 1547
攒了一身酷
攒了一身酷 2020-11-22 13:32

Where are MIN and MAX defined in C, if at all?

What is the best way to implement these, as generically and type safely as possible? (Compil

14条回答
  •  余生分开走
    2020-11-22 14:22

    Looks like Windef.h (a la #include ) has max and min (lower case) macros, that also suffer from the "double evaluation" difficulty, but they're there for those that don't want to re-roll their own :)

提交回复
热议问题