title: C/C++ nullptr dereference
body: <p>Since de-referencing <code>nullptr</code> (<code>NULL</code>) is an undefined behavior both in <code>C</code> and <code>C++</code>, I am wondering if expression <code>&amp;(*ptr)</code> is a valid one if ptr is <code>nullptr</code> (<code>NULL</code>).</p>
  
  <p>If it is also an undefined behavior, how does <a href="https://stackoverflow.com/a/142023">OFFSETOF</a> macro in the linked answer work?</p>
  
  <p>I always thought that <code>ptr-&gt;field</code> is a shorthand for <code>(*ptr).field</code></p>
  
  <p>I think the answer to my question is similar in C and C++.</p>