#include #include #include //for strcmp #include "date.h" using namespace std; //Function declarations: int min(int a, int b); double min(double a, double b); date min(date a, date b); const char *min(const char *a, const char *b); int main() { date today; date tomorrow {today + 1}; //= operator+(today, 1); cout << ::min(10, 20) << "\n" << ::min(3.14, 2.71) << "\n" << ::min(today, tomorrow) << "\n" << ::min("hello", "goodbye") << "\n"; return EXIT_SUCCESS; } int min(int a, int b) //function definition { if (b < a) { return b; } else { return a; } } double min(double a, double b) { if (b < a) { return b; } else { return a; } } date min(date a, date b) //should be passed and returned by reference { if (b < a) { //if operator<(b, a) { return b; } else { return a; } } const char *min(const char *a, const char *b) { //if (b < a) { would be wrong for this data type if (strcmp(b, a) < 0) { return b; } else { return a; } }