10 Nov
2005
10 Nov
'05
5:41 p.m.
Nigel Rantor wrote:
My understanding of uninitialised variables is that their *values* were undefined, that you could not rely on them to be any particular value, including not being within range for that type.
No, this is only true for "unsigned char". Accessing the value of an uninitialized object of any other type is undefined behavior, which means that you can - and in some cases will - get a hardware trap.
So, you can read them, ...
Not in portable code, although true in practice for most of today's hardware.