is there a way that I can make this work? Or do I need to use separate files?
#include <iostream> // Necessary
using namespace std;
#define long double mMaxOf2(long double min, long double max)
#define long double mMaxOf3(long double Min, long double Max, long double Mid)\
{\
mMaxOf2(mMaxOf2((Min), (Mid), (Max)));\
}
int main()
{
double primary;
double secondary;
double tertiary;
cout << "Please enter three numbers: ";
cin >> primary >> secondary >> tertiary;
cout << "The maximum of " << primary << " " << secondary << " " << tertiary;
cout << " using mMaxOf3 is " << (mMaxOf3(primary, secondary, tertiary));
return 0;
}
Problem lies with mMaxOf3, it isn’t declared… Hmm maybe I need the prototype.
Multi line macros require a \ character at the end of each line (except the last).