#include <windows.h>
#include <limits>
int main()
{
std::numeric_limits<char>::max();
}
The compiler (.NET 2003 standard) says:
: warning C4003: not enough actual parameters for macro 'max'
: error C2589: '(' : illegal token on right side of '::'
: error C2143: syntax error : missing ';' before '::'
If I don't include windows.h, it compiles just fine. What's wrong?!
Edit: < >
[edited by - Matsen on October 8, 2003 4:11:35 AM]
limits and windows.h a no no?
limits doesn't seem to like windows.h, or vice versa. For some strange reason, this does not compile:
Windows defines macros named min and max (which I think should be named MIN and MAX). Define NOMINMAX before including windows.h to prevent this.
// Website // Google // GameDev // NeHe // MSDN // OpenGL Extensions //
~nz
// Website // Google // GameDev // NeHe // MSDN // OpenGL Extensions //
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement