C++参数宏

#include <iostream>
using namespace std;

// 使用define 定义带有参数的宏
#define MIN(a,b)(a<b ? a:b)
int main()
{
	int i, j;
	i = 100;
	j = 30;
	cout << MIN(i, j) << endl;

	system("pause");
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq2942713658/article/details/81811491
今日推荐