title: Comparison between two objects under the same class
body: <p>I am still new to C++ (programming in general)and forgive me if this question is stupid or  has been asked numerously.
  Here is the question..Let's say there are two objects  A and B under the same class.</p>
  
  <p>e.g</p>
  
  <pre><code>  class Fruit{
    int apple;
    int banana;
        fruit(int x, int y){
         apple=x;
         banana=y;
        }
    }
    Fruit A(1,1);
    Fruit B(1,1);
  </code></pre>
  
  <p>If I want to check if content from Object A is the same as Object B's, do I have to compare every variablefrom A to B, or </p>
  
  <pre><code>   if(Object A == Object B)
     return true;
  </code></pre>
  
  <p>will do the job?</p>