Download this source file


// MaxInline.cpp - A program to show an inline function.
//
// Written by: Wayne Pollock, Tampa Florida 1999

#include <iostream>

inline int max (int x, int y = 0)
{
   if (x > y)
      return x;
   else
      return y;
}

int main ()
{
   int i = 5, j = 12;

   cout << "The max of " << i << " and " << j
        << " is " << max(i, j) << "." << endl;

   return 0;
}