maccatalan
Registered
Hi.
As you know, a sizeof() function exists. It returns the number of bits that the type you put as argument needs to be stored in memory.
This number can be different from a platform to another, from a compiler to another.
but this is not what I need.
I just would like the max value (the range of values) that the value type allows. We can compute it thanks to 2^sizeof(type)-1 when unsigned (else divide by two) but 2^sizeof(type) is greater than the max allowed value so it should not work.
Any suggestion ?
thank you very much,
Pierre
As you know, a sizeof() function exists. It returns the number of bits that the type you put as argument needs to be stored in memory.
This number can be different from a platform to another, from a compiler to another.
but this is not what I need.
I just would like the max value (the range of values) that the value type allows. We can compute it thanks to 2^sizeof(type)-1 when unsigned (else divide by two) but 2^sizeof(type) is greater than the max allowed value so it should not work.
Any suggestion ?
thank you very much,
Pierre