title: Help with Object Oriented Programming with C++
body: <p>I need some help figuring this out if it is possible.  I am still very new to this so please forgive me.  I have an array of an object that I want a method to manipulate for me.  I'm not sure how to best put this in words so I will use an example.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class fruit
  {
      private:
          int amount;
      public:
          void eat();
  };
  void fruit::eat()
  {
      //manipulate the amount for apples at both indexes here
  }
  
  int main()
  {
      fruit apples[2];
      fruit pie;
  
      pie.eat();
  
  return 0;
  }
  </code></pre>
  
  <p>I want to change the amount at both indexes in the apples array using the eat() function.  How would I go about doing this.  I'm sorry if this seems stupid.</p>