Note that there are some explanatory texts on larger screens.

plurals
  1. POOfficial names for pointer operators
    text
    copied!<p>What are the official names for the operators <code>*</code> and <code>&amp;</code> in the context of pointers? They seem to be frequently called <em>dereference operator</em> and <em>address-of operator</em> respectively, but unfortunately, the section on unary operators in the standard does not name them.</p> <p>I really don't want to name <code>&amp;</code> <em>address-of</em> anymore, because <code>&amp;</code> returns a pointer, not an address. (see below) The standard is very clear about this:</p> <blockquote> <p>The result of the unary <code>&amp;</code> operator is a <strong>pointer</strong> to its operand.</p> </blockquote> <p>Symmetry suggests to name <code>&amp;</code> <em>reference operator</em> which is a little unfortunate because of the collision with references in C++. The fact that <code>&amp;</code> returns a pointer suggests <em>pointer operator</em>. Are there any official sources that would confirm these (or other) namings?</p> <h2>pointers vs. addresses</h2> <p>A pointer is a language mechanism, while an address is an implementation detail. Addresses are untyped, while pointers aren't, except for <code>void*</code>. Kevlin Henney also distinguishes between pointers and addresses in an <a href="http://www.se-radio.net/transcript-91-kevlin-henney-c" rel="nofollow noreferrer">Interview</a>:</p> <blockquote> <p>C [...] allows us to abstract the specifics of the machine to the point that we are talking about pointers and not addresses. There is a whole load of pain that you no longer have to go through.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload