O
ozbear
In another thread related to size_t and SIZE_MAX, a #define
was suggested for SIZE_MAX where is it not predefined.
The #define was:
#define MY_SIZE_MAX ((size_t)-1)
I have tried this on my system in a printf and it yields a
reasonable value but I do not fully understand how it it
evaluated. size_t is a /type/, defined on my system as
typedef unsigned int size_t;
The part I do not understand is the the meaning of subtracting 1
from a /type/ rather than an expression? How does the compiler
evaluate this?
Oz
was suggested for SIZE_MAX where is it not predefined.
The #define was:
#define MY_SIZE_MAX ((size_t)-1)
I have tried this on my system in a printf and it yields a
reasonable value but I do not fully understand how it it
evaluated. size_t is a /type/, defined on my system as
typedef unsigned int size_t;
The part I do not understand is the the meaning of subtracting 1
from a /type/ rather than an expression? How does the compiler
evaluate this?
Oz