title: Creating instance in an another class of an object
body: <p>I need to create an instance in class Crop of Plant class and i cant manage to find a way to make that work. Hope you guys can help at that.</p>
  
  <p>This my main where i'm sending an object to the class crop. </p>
  
  <pre><code>int main(){
  
  char select = 'a';
  int plant_num = 2;
  int crop_num = 0;
  
  Crop crop[10];
  Plant plant[20];
  
  plant[0] = Plant("Carrots",'c');    
  plant[1] = Plant("Lettuce",'l');
  plant[2] = Plant("Rosemary",'r');
  
  crop[0] = Crop(plant[0],4,2);
  crop_num++;
  
  cout &lt;&lt; "Garden Designer" &lt;&lt; endl;
  cout &lt;&lt; "===============";
  
  }
  </code></pre>
  
  <p>class crop is where i want the instance of plant class</p>
  
  <pre><code>class Crop {
  
  private:
      int g_length;
      int w_width;
      Plant PlantType;
  
  public:
      Crop();
      Crop(const Plant&amp;, int, int);
  
  };  
  </code></pre>
  
  <p>class plant of which i want the instance of in class crop</p>
  
  <pre><code>class Plant {
  
  private:
      char plant[20];
      char p_symbol;
  
  public: 
      Plant();
      Plant(const char* n, char s);
  };
  </code></pre>
  
  <p>Crop.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;cstring&gt;
  #include &lt;new&gt;
  #include "crop.h"
  using namespace std;
  
  
  Crop::Crop(){
  
  
  
  }
  
   Crop::Crop(const Plant&amp; temp, int l, int w){
  
  
  
  }
  </code></pre>
  
  <p>sorry if im missing something. really confused if you need Plant.cpp file content just ask me. I didn't think that file would be needed. </p>