title: What is the difference between "this" and "::"?
body: <p>Inside setMyInt function I have used two statements to set myInt variable. Though both of them gives me the same result. Is there any conceptual difference in working of them? </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  class Bar{
      int myInt;
  
  public:
      const int getMyInt() const {
          return myInt;
      }
  
      void setMyInt(int myInt) { 
  
          Bar::myInt = myInt;
         this-&gt;myInt=myInt;
      }
  };
  
  int main(){
      Bar obj;
      obj.setMyInt(5);
      cout&lt;&lt;obj.getMyInt();
      return 0;
  }
  </code></pre>