Home > Programming > Functions using the "C" programming language > example32.cpp |
/*
In this example we demonstrate the usage of an inline function.
*/
/*
Note: C++ compiler is needed.
*/
#include <stdio.h>
#include <conio.h>
/*
Inline function declaration.
*/
inline long cube( long lv )
{
return lv*lv*lv;
}
void main()
{
long l,r;
for( l=1; l<=10; l++ )
{
r = cube( l );
printf("\n%ld\n",r);
}
getch();
}
© 2004 Jim Valavanis