In Microsoft Visual C++, there is a constant called MAXDWORD defined in winnt.h as follows:
#define MAXDWORD 0xffffffff
It’s useful as a high initial value for a ‘double’ when one is searching for the lowest value in a collection.
Google though I might, I can’t find the equivalent in standard headers on Linux, but I’m willing to bet there must be one.
I’m using:
- uBuntu 10.04 64bit
- g++ 4.4.3
Standard solution is to use
std::numeric_limits. For instance,std::numeric_limits<long>::max(). You could use any standard type instead oflongthere. You even can to specializenumeric_limitsfor custom types.