C利用宏定义写一些小函数

求最大值、求余数:

 1 #include <stdio.h>
 2 
 3 #define SURPLUS(A,B) ((A)%(B)) 
 4 #define max(A,B) (A>B ? A:B)
 5 
 6 main()
 7 {
 8     printf("%d
",max(2,3));
 9     //getch();
10     return 0;
11 }
原文地址:https://www.cnblogs.com/yongjiuzhizhen/p/4305290.html