1#include <iostream>
2
3using namespace std;
4
5inline int Max(int x, int y) {
6 return (x > y)? x : y;
7}
8
9// Main function for the program
10int main() {
11 cout << "Max (20,10): " << Max(20,10) << endl;
12 cout << "Max (0,200): " << Max(0,200) << endl;
13 cout << "Max (100,1010): " << Max(100,1010) << endl;
14
15 return 0;
16}
1Inline Member Functions (C++)
2A member function that is both declared and defined in the class member list is called an inline member function. Member functions containing a few lines of code are usually declared inline.
3