Is it safe to cast a null to struct just to get the size:
Example:
sizeof(((MEMORY_STRUCT*)0)->GWCD.sid)
Thanks JD
says,
"The sizeof operator yields the size (in bytes) of its operand, which may be an expression ... The size is determined from the type of the operand, which is not itself evaluated" (my emphasis).
Which sounds like you should be safe?
Presumably you were worried about the NULL pointer? I don't think that should be a problem - as the expression is not evaluated...?
Crystal clear...
Thank you. JD