title: Why is the pointer value in the function different to the one passed in as an argument?
body: <p>I have the following constructor:</p>
  
  <pre><code>MutexWrapper::MutexWrapper(Mutex * pMutex)
  {
    DebugPrint("0x%x", pMutex); // displays 0x1f83e54
  }
  </code></pre>
  
  <p>And it gets called in the following function:</p>
  
  <pre><code>void OnReviewBuffer_Callback( void * pUserData )
  {
    ReviewBuffer * thePointer = (ReviewBuffer *) pUserData;
  
    DebugPrint("0x%x", thePointer); // this displays 0x1f83e48
  
    MutexWrapper theMutexWrapper(thePointer);
  }
  </code></pre>
  
  <p>Unfortunately I can't provide the entire definition of <code>ReviewBuffer</code> - but I hope the below is enough:</p>
  
  <pre><code>class ReviewBuffer  : public StreamConsumer_Base, public Mutex
  {
    ...
  };
  </code></pre>
  
  <p>The problem is that when I print out <code>thePointer</code> I get <code>0x1f83e48</code>, but the value printed from inside the constructor is <code>0x1f83e54</code>.</p>
  
  <p>Why are the pointer values different - is this something to do with pass by value passing in a copy of the pointer?</p>