function macro : Macro Expansion « Development « C++ Tutorial






#include <iostream>
using namespace std;

#define getmax(a,b) ((a)>(b)?(a):(b))

int main()
{
  int x=5, y;
  y= getmax(x,2);
  cout << y << endl;
  cout << getmax(7,x) << endl;
  return 0;
}








5.18.Macro Expansion
5.18.1.function macro
5.18.2.standard macro names: __LINE__, __DATE__, __cplusplus
5.18.3.Macro Expansion