title: C++ Member Variables
body: <p>Consider the following class:</p>
  
  <pre><code>class A
  {
    A();
    int number;
    void setNumber(int number);
  };
  </code></pre>
  
  <p>You could implement 'setNumber' in 3 ways:</p>
  
  <p><strong>Method 1</strong>: Use the 'this' pointer.</p>
  
  <pre><code>void A::setNumber(int number)
  {
    this-&gt;number = number;
  }
  </code></pre>
  
  <p><strong>Method 2</strong>: Use the scope resolution operator.</p>
  
  <pre><code>void A::setNumber(int number)
  {
    A::number = number;
  }
  </code></pre>
  
  <p><strong>Method 3</strong>: Instead, denote all member variables with 'm' or '_' (this is my preferred method).</p>
  
  <pre><code>void A::setNumber(int number)
  {
    mNumber = number;
  }
  </code></pre>
  
  <p>Is this just personal preference, or is there a benefit to choosing a particular method?</p>