宏定义与使用实例

#include <stdio.h>

int f1(int a, int b)
{
    #define _MIN_(a,b) ((a)<(b) ? a : b)
    
    return _MIN_(a, b);
}

int f2(int a, int b, int c)
{
    return _MIN_(_MIN_(a,b), c);
}

int main()
{
    printf("%d ", f1(2, 1));
    printf("%d ", f2(5, 3, 2));
    
    return 0;
}

原文地址:https://www.cnblogs.com/wxb20/p/6145989.html