Q:

How can I properly use Inline functions? C++ - What type does it have to be?

doubles seem not to work. can I only use int?
I heard that I can use C++ function templates to change this to double. I'm not sure how to go about that though.
 #include <iostream>                                                     // Necessary 
using namespace std;
#define mMaxOf2(max, min) ((max) > (min) ? (max) : (min))
#define mMaxOf3(Min, Mid, Max)\
{\
     mMaxOf2(mMaxOf2((Min), (Mid)),(Max))\
}
inline long double fMaxOf2(long double min, long double max)
{
    return max > min ? max : min;
}

inline long double fMaxOf3(long double Min, long double Mid, long double Max)
{
      return fMaxOf2(Min, fMaxOf2( Mid, Max));
    //fMaxOf2(Min, fMaxOf2( Mid, Max));     caused nan   problem      
}

int main()
{
    double primary;
    double secondary;
    double tertiary;

    cout << "Please enter three numbers: ";
    cin >> primary >> secondary >> tertiary;
    cout << "The maximum of " << primary << " " << secondary << " " << tertiary;

    long double maximum = mMaxOf3(primary, secondary, tertiary);
    cout << " using mMaxOf3 is " << maximum;

    cout << "\nThe maximum of " << primary << " " << secondary << " " << tertiary;
    long double maxim = fMaxOf3(primary, secondary, tertiary);
    cout << " using fMaxOf3 is " << maxim;

    return 0;
}

So the problem was 
    inline long double fMaxOf2(long double min, long double max)
    {
        return max > min ? max : min;
    }

    inline long double fMaxOf3(long double Min, long double Mid, long double Max)
    {
        fMaxOf2(Min, fMaxOf2( Mid, Max));    // This was wrong
        // It was fMaxOf2 (fMaxOf2(Min, Mid, Max);
    }

Anyway now I get a new error... says maxim is nan... 
Solved it. Thanks Everyone!

A:

Using templates:
template<class T>
inline T fMaxOf2(T min, T max)
{
    return max > min ? max : min;
}

template<class T>
inline T fMaxOf3(T Min, T Mid, T Max)
{
    fMaxOf2(Min, fMaxOf2(Mid, Max));
}

To use the functions:
double max = fMaxOf3<double>(0.231, 123.21312, 904.4);

Now you may ask, why is that? Templates accepts, well, template arguments. T in template<class T> is the argument for the two functions. T now can be used in your functions as a "normal" type or class.

