title: How to know an object address in a method?
body: <p>For example I have this class:</p>
  
  <pre><code>class example{
  public:
         int beauty;
        void CompareObject(const example&amp; another_object, example*&amp; ptr);
  };
  </code></pre>
  
  <p>The method CompareObject() compares this object with the object another_object, (by reference) and saves the address of the most beautiful object in the pointer ptr (also passed by reference)</p>
  
  <p>The problem is in CompareExampleObject:</p>
  
  <pre><code>void CompareExampleObject (const example&amp; another_object, example*&amp; ptr){
      // set the best object
      if(beauty &lt; another_object.beauty)
          ptr = &amp;another_object;
      else
          ptr = // !!! What should I write here?
  }
  </code></pre>