MIN and MAX in C

后端 未结 14 1632
攒了一身酷
攒了一身酷 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:33

    The simplest way is to define it as a global function in a .h file, and call it whenever you want, if your program is modular with lots of files. If not, double MIN(a,b){return (a is the simplest way.

提交回复
热议问题