title: error: invalid use of non-static member function C++
body: <p>I have two classes that I want to chain-call (main -> execute -> calculate). However, the issue is that when I use:</p>
  
  <pre><code>&amp;calculate::addition;
  </code></pre>
  
  <p>Addition will not be called even if the compiler doesn't return any error. If I try to remove the reference to</p>
  
  <pre><code>calculate::addition;
  </code></pre>
  
  <p>The compiler returns error </p>
  
  <pre><code>error: invalid use of non-static member function ‘void calculate::addition(double&amp;, double, double)’
       case 'a' : *calculate::addition; break;
                              ^~~~~~~~
  </code></pre>
  
  <p>Tried using static before void with the same result as using reference.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  class execute{
     public:
       void exec(char);
  }jalan;
  class calculate {
     public:
       void addition(double&amp;, double, double);
       void substraction(double&amp;, double, double);
       void multiply(double&amp;, double, double);
       void division(double&amp;, double, double);
  };
  int main(void){
  static double a, b;
  static double result;
    std::cout &lt;&lt; "Type a, b, c, or d" &lt;&lt; std::endl;
    std::cout &lt;&lt; "a. Addition\nb. Substraction\nc. Multiply\nd. Division" &lt;&lt; std::endl;
    std::cout &lt;&lt; "Your Input: ";
        static char option;
      option = getchar();
                  std::cout &lt;&lt; "First value: ";
                  std::cin &gt;&gt; a;
                  std::cout &lt;&lt; "Next value: ";
                  std::cin &gt;&gt; b;
        jalan.exec(option);
      std::cout &lt;&lt; result &lt;&lt; std::endl;
                  return 0;
  }
  void execute::exec (char option){
      switch(option){
                                  case 'a' : &amp;calculate::addition; break;
                                  case 'b' : &amp;calculate::substraction; break;
                  case 'c' : &amp;calculate::multiply; break;
                  case 'd' : &amp;calculate::division; break;
          }   
  }
  void calculate::addition(double&amp; result, double a, double b){
              result = a+b;   
  }
  void calculate::substraction(double&amp; result, double a, double b){
              result = a-b;   
  }
  void calculate::multiply(double&amp; result, double a, double b){
              result = a*b;   
  }
  void calculate::division(double&amp; result, double a, double b){
              result = a/b;   
  }
  </code></pre>