Where should g++ find a 'max' macro or function ?

Eljay Love-Jensen eljay@adobe.com
Mon Nov 10 12:53:00 GMT 2003


Hi Michael,

In C++ (and in C) it's strongly recommended that you include the proper header file that declares the symbols utilized.

Try this in your little program:
/* -------------------------------------------------------- */
#include <algorithm>
    using std::max;

int maxxx(int a, int b)
{
    return max(a,b);
}
/* -------------------------------------------------------- */

HTH,
--Eljay




More information about the Gcc-help mailing list