In the comments - what is already done
Create a class of real numbers Double.
// Define an overloaded function that returns the maximum of two arguments.
// The function is not a member of the Double class.
Overloaded functions have arguments of type int, double, Double.
// The body of overloaded functions should be the same.
Here is the question of how to make a Double?
#include "stdafx.h" class Double{ }; int func(int num1, int num2){ int value; if (num1 > num2) value = num1; if (num1 < num2) value = num2; return value; } double func(double num1, double num2){ double value; if (num1 > num2) value = num1; if (num1 < num2) value = num2; return value; } int _tmain(int argc, _TCHAR* argv[]) { return 0; } By the way, how to check the input number double or int?
max(num1,num2), if you needT func(const T num1, const T num2) { if (num1 < num2) return num1; return num2; }T func(const T num1, const T num2) { if (num1 < num2) return num1; return num2; }T func(const T num1, const T num2) { if (num1 < num2) return num1; return num2; }For yourDoubleclass, you can writepair<double,double>and so on. - paveloperator<for yourDoubleto start. Learn how to do this correctly. - VladDclass Double... - Harry