title: I keep getting a error:"no operator >> matches thees operands" on variables that are int and bool. In the >> operator overload
body: <pre><code>class user
  {
  private:
      std::string  first_name;
      std::string middle_name;
      std::string  last_name;
       int ID;
       static int next_id;
  
  public:
  
           static int next_user_id()
          {
          next_id++;
          return next_id;
          }
          group User_Group;   
          void set_ID(int c)
          {
          ID=c;
          }
          int get_ID()
          {
          return ID;
          }
          void set_first_name(std::string c)
          {
              first_name=c;
          }
          string get_first_name()
          {
          return first_name;
          }
          void set_middle_name(std::string c)
          {
              middle_name=c;
          }
          string get_middle_name()
          {
              return middle_name;
          }
          void set_last_name(std::string c)
          {
              last_name=c;
          }
          string get_last_name()
          {
               return last_name;
          }
          user()
          {
              ID = user::next_id++;
          }
  friend istream operator&gt;&gt;(istream is, user User);
  friend ostream operator&lt;&lt;(ostream os, user User);
  };
  int user::next_id;
  istream operator&gt;&gt;(istream is, user User)
  {
      is &gt;&gt; User.get_first_name();
      is &gt;&gt; User.get_middle_name();
      is &gt;&gt; User.get_last_name();
      is &gt;&gt; User.get_ID();
      is &gt;&gt; User.User_Group.get_name();
      for(int j=0;j&lt;=4;j++)
      {
          is &gt;&gt; User.User_Group.Week_Food[j].get_breakfsat();
          is &gt;&gt; User.User_Group.Week_Food[j].get_lunch();
          is &gt;&gt; User.User_Group.Week_Food[j].get_dinner();
      }
      for (int j=0;j&lt;=30;j++) 
      {
          is &gt;&gt; User.User_Group.Month_Food[j].get_breakfsat();
          is &gt;&gt; User.User_Group.Month_Food[j].get_lunch();
          is &gt;&gt; User.User_Group.Month_Food[j].get_dinner();
      }
  }
  
  
  ostream operator&lt;&lt;(ostream os, user User)
  {
      os&lt;&lt;User.get_first_name()&lt;&lt;" "&lt;&lt; User.get_middle_name() &lt;&lt;" "&lt;&lt;User.get_last_name()&lt;&lt;" ";
          for(int j=0;j&lt;=4;j++)
          {
          os&lt;&lt;User.User_Group.Week_Food[j].get_breakfsat()&lt;&lt;" "&lt;&lt;User.User_Group.Week_Food[j].get_lunch()&lt;&lt;" "&lt;&lt; User.User_Group.Week_Food[j].get_dinner()&lt;&lt;" ";
          }
          for (int j=0;j&lt;=30;j++) 
          {
          os&lt;&lt; User.User_Group.Month_Food[j].get_breakfsat()&lt;&lt;" "&lt;&lt;User.User_Group.Month_Food[j].get_lunch()&lt;&lt;" "&lt;&lt;User.User_Group.Month_Food[j].get_dinner();
          }
  }
  </code></pre>
  
  <p>I'm new to c++ and maybe this is a dumb question but I need to write a array of objects to a file and read it form there by overloading the &lt;&lt; and  >> operators. I get the error when i try to use it for members of the class that are int and bool. It seems to work ok for the the string types so I dont know how to proceed.</p>