The following program demonstrates the use of use of inline function.
#include <iostream.h> inline int cube( int s) { return s*s*s; } int main() { cout << "The cube of 3 is: " << cube(3) << "\n" ; return 0; }
//Output: The cube of 3 is: 27 |