title: C++ Cannot call member function inside the class
body: <p>I'm wondering why it's not possible to call a member function from a static function </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  class A{
  public:
    A(){}
    ~A(){}
    static void astaticFunction(){
      printHello();
    }
  
  private:
    void printHello(){
      std::cout &lt;&lt; "Hello" &lt;&lt; std::endl;
    }
  
  };
  
  int main(int argc, char **argv){
    A::astaticFunction();
    return 0;
  
  }
  </code></pre>
  
  <p>the compiler is returning this </p>
  
  <pre><code>main.cpp: In static member function ‘static void A::astaticFunction()’:
  main.cpp:8:16: error: cannot call member function ‘void A::printHello()’ without object
  </code></pre>
  
  <p>And how can I use it ?
  Thanks </p>