title: What's wrong with this Callback?
body: <p>This is my <a href="http://coliru.stacked-crooked.com/a/b7bca488e23333c9" rel="nofollow">code</a>:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  
  using namespace std;
  
  typedef void (*CallbackType)(double); 
  
  class LFO
  {
  private:
  
  public:
      CallbackType target;
  
      inline void Process() {
          double value = 1.3;
          target(value);
      }
  };
  
  class ExternalObject
  {
  private:
  
  public:
      double mTest = 1.0;
  
      ExternalObject() {
  
      }
      ~ExternalObject() {
  
      }
  
      inline void PrintValue(double value) {
          cout &lt;&lt; "passed: " &lt;&lt; value &lt;&lt; endl;
      }
  };
  
  int main ()
  {
      ExternalObject eo;
      LFO lfo;
  
      lfo.target = eo.PrintValue;
      lfo.Process();
  }
  </code></pre>
  
  <p>I want to execute within LFO's Process the callback PrintValue of ExternalObject. But it seems I cannot pass <code>lfo.target</code> in this way? Where am I wrong? (sorry, I'm new to C++; in JavaScript this is the way I'll do it).</p>