title: c++ classes: different ways to write a function
body: <p>what's the difference between the following 3 cases:</p>
  
  <p><strong>1)</strong> in point.h:</p>
  
  <pre><code>class point
  {
      int x,y;
      public:
      int getX();
  };
  
  int point::getX() {
      return this-&gt;x;
  }
  </code></pre>
  
  <p><strong>2)</strong> in point.h:</p>
  
  <pre><code>class point
  {
      int x,y;
      public:
      int getX()
      {
          return this-&gt;x;
      }
  };
  </code></pre>
  
  <p><strong>3)</strong> in point.h:</p>
  
  <pre><code>class point
  {
      int x,y;
      public:
      int getX();
  };
  </code></pre>
  
  <p>int point.cpp:</p>
  
  <pre><code>int point::getX() {
      return this-&gt;x;
  }
  </code></pre>
  
  <p>Note: I read that it's somehow connected to inline but not sure which one of them makes the compiler to treat <code>int getX()</code> and <code>inline int getX()</code></p>