Isn't there already a max function in the algorithm header file?
And by using namespace std;, I'm importing the function to the global namespace (which takes to arguments, and in this case both would be integers, so it shouldn't be an overload).
So why isn't there any naming conflict?
#include <iostream>
#include <algorithm>
using namespace std;
int max(int a, int b)
{
return (a > b) ? a : b;
}
int main()
{
cout << max(5, 10) << endl;
}