title: What is throwing the error the static or the const?
body: <p>The following code is throwing an error message and I can't figure out what the issue is - is it the word <code>static</code>, or <code>const</code>? What am I doing wrong? </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class SampleClass
  {
  private:
  
      int value;
      static int counter;
  
  public:
  
      SampleClass(int i)
      {
          value = i; 
          counter++;
      }
  
      static int countSomeClass() const
      {
          return counter;
      }
  
      void showValue()
      {
          cout &lt;&lt; value &lt;&lt; endl;
      }
  
  };
  
  int main()
  {
      SampleClass test(50);
      test.showValue();
      test.countSomeClass();
      return 0;
  }
  </code></pre>
  
  <p>Error message: </p>
  
  <blockquote>
    <p>main.cpp:16:35: error: static member function static int SampleClass::countSomeClass() cannot have cv-qualifier<br>
       static int countSomeClass() const</p>
  </blockquote>