title: C++ difference between reference, objects and pointers
body: <p>This is a question from an exam in an advanced course in OOP, taught in C++ (in TAU university, this semester):</p>
  
  <p>Q:  What is the difference between a C++ pointer and a reference?  </p>
  
  <pre>
  A.  A reference is the entire object while a pointer is only the address of it.
  B.  The same meaning, and difference is only in syntax and usage.
  C.  The syntax used to access the object.
  D.  Pointers are simple address to the object while a reference uses the virtual table.
  </pre>
  
  <p>Which is the correct answer?</p>
  
  <p>The course teacher claims that A is the correct one, and that a reference to an object is, in fact, the object itself. Is that correct? I realize that accessing the reference is equivalent to accessing the object itself, however, when destructing a reference, we do not destruct the object itself. A reference is an alternative name for the object, but saying that reference==object true?</p>
  
  <p>BTW, the lecturer gave <a href="https://isocpp.org/wiki/faq/references" rel="nofollow noreferrer">the following link to an faq as support for his claim</a>, a quote:</p>
  
  <blockquote>
    <p>"Important note: Even though a
    reference is often implemented using
    an address in the underlying assembly
    language, please do not think of a
    reference as a funny looking pointer
    to an object. <strong><em>A reference is the
    object</em></strong>. It is not a pointer to the
    object, nor a copy of the object. It
    is the object."</p>
  </blockquote>
  
  <p>But still, I believe this is incorrect.</p>