title: What does this compiler error means - "qualified-id in declaration before ‘=’ token" in C++?
body: <p>I am trying to understand the usage of private const in the class.
  My understanding is that private const is used to make something constant within the class and static to have one copy.</p>
  
  <p>Initially, my code was using pi and it's data type was float. So, I tried changing the float to int because I read const static is only allowed for int types within class. </p>
  
  <pre><code>#include &lt;iostream&gt;
  class MyExample
  {
  
   private:
     static const int x;
  
  };
  
  int main(void)
  {
    int const  MyExample::x = 3;
  
    std::cout&lt;&lt;"x value is "&lt;&lt;MyExample::x&lt;&lt;std::endl;
  
    return 0;
  }
  </code></pre>
  
  <p>compiling - </p>
  
  <pre><code>$g++ -std=c++14 test.cpp
  test.cpp: In function ‘int main()’:
  test.cpp:12:27: error: qualified-id in declaration before ‘=’ token
     int const  MyExample::x = 3;
  </code></pre>
  
  <p>I know that moving the line " int const  MyExample::x = 3;" from main() to outside, removes error if I remove private also.</p>