What is the maximum value for a UInt32?
Is there a way I can use the sizeof operator to get the maximum value (as it is unsigned)? So I don't end up with #defines or magic numbers in my code.
There's a macro UINT32_MAX
defined in stdint.h
which you can use
#include <stdint.h>
uint32_t max = UINT32_MAX;
<stdint.h>
:http://pubs.opengroup.org/onlinepubs/009695299/basedefs/stdint.h.html
See also: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf
Original source of the ISO documents: https://www.iso.org/standard/82075.html