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:
Standard solution is to use std::numeric_limits
. For instance, std::numeric_limits<long>::max()
. You could use any standard type instead of long
there. You even can to specialize numeric_limits
for custom types.
# define UINT_MAX 4294967295U
Found in /usr/include/limits.h
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With