title: How to initialize a member using its parameterized constructor
body: <p>It's hard to describe without code so here goes:
  I'm trying to prototype an object (b) in the header file of another(a), then in the constructor of (a) call (b)'s constructor and pass it values, so i can then use the methods of b which depend on its constructor and the values passed to it, but the way im doing gives: red underlined in the open bracket of pricing's constructor says: "no default constructor exists for monteCarlo" and then on the next line m is underlined red saying: "call of object of a class type without appropriate operator() or conversion functionsto pointer-to-function type". Any other critic of my program is very welcome, i am trying to learn to program, and well.</p>
  
  <p>in the file pricing.cpp i have:</p>
  
  <pre><code>#include "pricing.h"
  #include &lt;math.h&gt;
  #include &lt;vector&gt;
  pricing::pricing(void)
  {
   m(10,0.0,0.01,50);
  }
  double pricing::expectedValue(void)
  {
  expectedExValue = m.samplePaths[2][3]; //yes this isn't an expected value, 
  // its just for illustration purposes/making it compile.
  return 0;
  }
  </code></pre>
  
  <p>in pricing.h i have:</p>
  
  <pre><code>#pragma once
  #include "pricing.h"
  #include "monteCarlo.h"
  class pricing
  {
  public:
  pricing(void);
  ~pricing(void);
  double euroCall();
  std::vector&lt;double&gt; samplePathing;
  double expectedValue();
      monteCarlo m;
  
  };
  </code></pre>
  
  <p>then montecarlo.cpp looks like: </p>
  
  <pre><code>#include "monteCarlo.h"
  #include "randomWalk.h"
  #include &lt;vector&gt;
  #include &lt;iostream&gt;
  
  monteCarlo::monteCarlo(int trails, double drift, double volidatity, int density)
  {
  for (int i = 0; i &lt; trails; i++)
  {
      std::cout &lt;&lt; "Trail number " &lt;&lt; i+1 &lt;&lt;  std::endl;
      randomWalk r(drift,volidatity,density);
      r.seed();
      samplePaths.emplace_back(r.samplePath);
      std::cout &lt;&lt; std::endl &lt;&lt; std::endl;
  }
  }
  
  
  monteCarlo::~monteCarlo(void)
  {
  }
  </code></pre>
  
  <p>and finally montecarlo.h is:</p>
  
  <pre><code>#pragma once
  #include &lt;vector&gt;
  
  class monteCarlo
  {
  public:
  monteCarlo(int, double, double, int);
  ~monteCarlo(void);
  std::vector&lt; std::vector&lt;double&gt; &gt; samplePaths;
  };
  </code></pre>