title: How can i modify variables in static member function?
body: <p>I have a code below, i want to modify class's variables in static function but there is some error.
  How can i fix it with "this" pointer?</p>
  
  <p>There is no access to "this" pointer for static members in class,on the other hand I am trying to make an access to class variables in Static member function, therefore i am looking for a way to use "this" pointer of class "me" to do it.</p>
  
  <pre><code>class me {
    public:
       void X() { x = 1;}
       void Y() { y = 2;}
  
  static void Z() {
    x = 5 ; y = 10;
  }
  
  public:
    int x, y;
  };
  
  int main() {
    me M;
  
    M.X();
    M.Y();
    M.Z();
  
    return 0;
  }
  </code></pre>
  
  <p>I got this <code>error</code> :</p>
  
  <blockquote>
    <p>invalid use of member ‘me::x’ in static member function.</p>
  </blockquote>