C++ standard: dereferencing NULL pointer to get a reference? [duplicate]
问题 This question already has answers here : Is null reference possible? (4 answers) Closed 6 months ago . I'm wondering about what the C++ standard says about code like this: int* ptr = NULL; int& ref = *ptr; int* ptr2 = &ref; In practice the result is that ptr2 is NULL but I'm wondering, is this just an implementation detail or is this well defined in the standard? Under different circumstances a dereferencing of a NULL pointer should result in a crash but here I'm dereferencing it to get a