title: Need of :: to specify class for functions but not variables?
body: <p>Why do I need to use :: to denote if a function is a member function but I don't need to do it for the instance variables? I do understand that :: is used to differentiate between standalone and member functions, but I still don't get the variables part. I'll give an example of what I'm talking about.</p>
  
  <h2>Shape.h</h2>
  
  <pre><code># pragma once
  
  class Shape {
  
  private:
    int height;
    int width;
  
  public:
    Shape(int height, int width);
  
  }
  </code></pre>
  
  <h2>Shape.cpp</h2>
  
  <pre><code>#include "Shape.hpp"
  
  Shape::Shape(int height, int width) {
    this-&gt;height = height;
    this-&gt;width = width;
  }
  
  int Shape::getHeight() {
    return height;
  }
  
  int Shape::getWidth() {
    return width;
  }
  </code></pre>
  
  <p>Here, I have to to specify the class of the <code>Shape</code> constructor and the getters in order for the compiler to know what I'm talking about. So how come when I do <code>return height;</code> or <code>this-&gt;height</code> without specifying class it understands what I'm talking about. </p>