Define inline function : Inline « Macro Preprocessor « C / ANSI-C






Define inline function


#include <stdio.h>

inline int max(int a, int b)
{
  return a > b ? a : b;
}

int main(void)
{
  int x = 5, y = 10;

  printf("Max of %d and %d is: %d\n", x, y, max(x, y));

  return 0;
}

           
       








Related examples in the same category