title: How do streams work..Getting error "more than operator >> matches these operands"
body: <p>I'm not sure how streams works as I am fairly new to c++. I have a program which is suppose to add, delete, view and update records in a file. I've added stuff to file already but having problems with the others. Your help would be most appreciated.Here is a part of my driver.cpp</p>
  
  <pre><code>        int main()
      {
  
      Mainmenu();
      return 0;
      }
  
       void Mainmenu()
      {
      int option;
  
  
      cout &lt;&lt; "1: Clinic Visit\t\t";
      cout &lt;&lt; "2: Removal\t\t";
      cout &lt;&lt; "3: Exit Visit\t\t\n";
      cout &lt;&lt; "Select an option\n\n\n";
      cin &gt;&gt; option;
      system("cls");
  
      switch (option)
      {
      case 1:     
          Showclinic();
              break;
      case 2: //RemAnimal();
  
          break;
      case 3:
  
          exit(0);
          break;
      default:
          cout &lt;&lt; "unknown option";
      }
  
       } 
  
  
       void  Showclinic()
       {
      int x;
      Intervention inte;
  
      cout &lt;&lt; "1: ADD\n\n";
      cout &lt;&lt; "2: UPDATE\n\n";
      cout &lt;&lt; "3: VIEW\n\n";
      cout &lt;&lt; "4: VIEW ALL\n\n";
      cout &lt;&lt; "5: DELETE\n\n";
      cout &lt;&lt; "6: Exit\n\n";
      cout &lt;&lt; "Enter Choice\n";
      cin &gt;&gt; x;
      switch (x)
      {
      case 1:
          system("cls");
          cout &lt;&lt; "CURRENTLY ADDING DATA\n";
          addVisit("JSPCA.txt", inte);
  
          break;
      case 2:
          cout &lt;&lt; "UPDATE";
          system("cls");
          break;
      case 3:
          cout &lt;&lt; "VIEW";
          system("cls");
          break;
      case 4:system("cls");
          cout &lt;&lt; "VIEW ALL RECORDS ON FILE\n";
          ViewAll("JPSCA.txt",inte);
          system("pause");
          break;
      case 5:system("cls");
          cout &lt;&lt; "DELETE";
          system("cls");
          break;
      case 6:
          cout &lt;&lt; "EXIT";
  
          exit(0);
          break;
      default:
          cout &lt;&lt; "value of x unknown";
      }
  
      }
      std::istream &amp;operator&gt;&gt;(std::istream &amp;is, int i)
      {
  
     }
          //***********************************************************
       std::istream &amp;operator&gt;&gt;(std::istream &amp;is, Intervention &amp;i) {
  
  
      is &gt;&gt; i.getClient().getInterventionNo();
      is &gt;&gt; i.getClient().getClinic();
      is &gt;&gt; i.getClient().getFname();
      is &gt;&gt; i.getClient().getLname();
      is &gt;&gt; i.getClient().getPayment();
      is &gt;&gt; i.getAddress().getStreetNo();
      is &gt;&gt; i.getAddress().getStreetName();
      is &gt;&gt; i.getAddress().getTown();
      is &gt;&gt; i.getTelNo().getAreaCode();
      is &gt;&gt; i.getTelNo().getExchange();
      is &gt;&gt; i.getTelNo().getLine();
      is &gt;&gt; i.getAnimal().getBreed();
      is &gt;&gt; i.getAnimal().getType();
      is &gt;&gt; i.getAnimal().getGender();;
      is &gt;&gt; i.getAnimal().getAge();;
      is &gt;&gt; i.getAnimal().getProblem();;
      is &gt;&gt; i.getDate().getDay();
      is &gt;&gt; i.getDate().getMonth();;
      is &gt;&gt; i.getDate().getYear();
      is &gt;&gt; i.getTime().getHour();
      is &gt;&gt; i.getTime().getMin();
      //is &gt;&gt; endl;
  
      return is;
      }
  
      std::ostream &amp;operator&gt;&gt;(std::ostream &amp;os, Intervention  &amp;const i) {
  
      os &lt;&lt; i.getClient().getInterventionNo();
      os &lt;&lt; i.getClient().getClinic() &lt;&lt; "";
       os &lt;&lt; i.getClient().getFname() &lt;&lt; "";
      os &lt;&lt; i.getClient().getLname() &lt;&lt; "";
      os &lt;&lt; i.getClient().getPayment() &lt;&lt; "";
      os &lt;&lt; i.getAddress().getStreetNo() &lt;&lt; "";
      os &lt;&lt; i.getAddress().getStreetName() &lt;&lt; "";
      os &lt;&lt; i.getAddress().getTown() &lt;&lt; "";
       os &lt;&lt; i.getTelNo().getAreaCode() &lt;&lt; "";
      os &lt;&lt; i.getTelNo().getExchange() &lt;&lt; "";
       os &lt;&lt; i.getTelNo().getLine() &lt;&lt; "";
      os &lt;&lt; i.getAnimal().getBreed() &lt;&lt; "";
      os &lt;&lt; i.getAnimal().getType() &lt;&lt; "";
      os &lt;&lt; i.getAnimal().getGender() &lt;&lt; "";
       os &lt;&lt; i.getAnimal().getAge() &lt;&lt; "";
      os &lt;&lt; i.getAnimal().getProblem() &lt;&lt; "";
      os &lt;&lt; i.getDate().getDay() &lt;&lt; "";
      os &lt;&lt; i.getDate().getMonth() &lt;&lt; "";
       os &lt;&lt; i.getDate().getYear() &lt;&lt; "";
      os &lt;&lt; i.getTime().getHour() &lt;&lt; "";
      os &lt;&lt; i.getTime().getMin() &lt;&lt; "";
       os &lt;&lt; endl;
  
      return os;
      }
  
  
        void addVisit(string name, Intervention inte)
      {
      int hour, min, day, month, yr, snum, age;
      string fname, lname, interNo, problem, clinic, area, ex, li,                      type,                    breed,sname,town, pay;
  
       cout &lt;&lt; "Enter new intervention number\n";
      cin &gt;&gt; interNo;
  
      // user enters information, which is copied into file
      cout &lt;&lt; "Enter name of clinic(Winchester or Caymanas)\n ";
      cin &gt;&gt; clinic;
      cout &lt;&lt; "Enter lastname, firstname\n ";
      cin &gt;&gt; lname;
      cin &gt;&gt; fname;
      cout &lt;&lt; "Please Address(Street#, Street Name, Town)\n";
      cin &gt;&gt; snum &gt;&gt; sname &gt;&gt; town;
      cout &lt;&lt; "Enter Contact#:(area exchange line)\n";
      cin &gt;&gt; area &gt;&gt; ex &gt;&gt; li;
      cout &lt;&lt; "Enter Animal Type, Breed,Gender and Age\n";
      cin &gt;&gt; type &gt;&gt; breed &gt;&gt; gender &gt;&gt; age;
      cout &lt;&lt; "Please specify problem\n";
      cin &gt;&gt; problem;
      cout &lt;&lt;( "Please enter letter for payment type:\n");
      cout &lt;&lt; ("Full=F\n");
      cout &lt;&lt; ("Contribution=C\n");
      cout &lt;&lt; ("Can't Pay=CP\n");
      cin &gt;&gt; pay;
      cout &lt;&lt; "Enter date in format month dd mm yyyy\n";
      cin &gt;&gt; day &gt;&gt; month &gt;&gt; yr;
      cout &lt;&lt; "Enter the time(hour minute\n)";
      cin &gt;&gt; hour &gt;&gt; min;
          // set record InterventionNo, Client,animal, date and time values
          //inte.setInterventionNo(input);
          inte.setClient(Client(fname, lname, pay,interNo,clinic));
          inte.setAddress(Address(snum, sname, town));
          inte.setTelNo(TelNo(area, ex, li));
          inte.setAnimal(Animal(type, breed, gender, age, problem));
          inte.setDate(Date(day, month, yr));
          inte.setTime(Time(hour, min));
  
  
          ofstream clientfile(name, ios::app);
          if (clientfile)
          {
              clientfile &lt;&lt; inte.getClient().getInterventionNo() &lt;&lt; "";
              clientfile &lt;&lt; inte.getClient().getClinic() &lt;&lt; "";
              clientfile &lt;&lt; inte.getClient().getFname() &lt;&lt; "";
              clientfile &lt;&lt; inte.getClient().getLname() &lt;&lt; "";
              clientfile &lt;&lt; inte.getClient().getPayment() &lt;&lt; "";
              clientfile &lt;&lt; inte.getAddress().getStreetNo() &lt;&lt; "";
              clientfile &lt;&lt; inte.getAddress().getStreetName() &lt;&lt; "";
              clientfile &lt;&lt; inte.getAddress().getTown() &lt;&lt; "";
              clientfile &lt;&lt; inte.getTelNo().getAreaCode() &lt;&lt; "";
              clientfile &lt;&lt; inte.getTelNo().getExchange() &lt;&lt; "";
              clientfile &lt;&lt; inte.getTelNo().getLine() &lt;&lt; "";
              clientfile &lt;&lt; inte.getAnimal().getBreed() &lt;&lt; "";
              clientfile &lt;&lt; inte.getAnimal().getType() &lt;&lt; "";
              clientfile &lt;&lt; inte.getAnimal().getGender() &lt;&lt; "";
              clientfile &lt;&lt; inte.getAnimal().getAge() &lt;&lt; "";
              clientfile &lt;&lt; inte.getAnimal().getProblem() &lt;&lt; "";
              clientfile &lt;&lt; inte.getDate().getDay() &lt;&lt; "";
              clientfile &lt;&lt; inte.getDate().getMonth() &lt;&lt; "";
              clientfile &lt;&lt; inte.getDate().getYear() &lt;&lt; "";
              clientfile &lt;&lt; inte.getTime().getHour() &lt;&lt; "";
              clientfile &lt;&lt; inte.getTime().getMin() &lt;&lt; "";
              clientfile &lt;&lt; endl;
              clientfile.close();
          }//end if
  
  
      else{
          cerr &lt;&lt; "Intervention #" &lt;&lt; interNo &lt;&lt; " already contains information. "     &lt;&lt; endl;
      }
      }
       //**********************************************************************
       void ViewAll(string name, Intervention inte)
       {
      std::ifstream in(name);
  
      std::copy(std::istream_iterator&lt;Intervention&gt;(in),
          std::istream_iterator&lt;Intervention&gt;(),
          std::ostream_iterator&lt;Intervention&gt;(std::cout, "\n"));
  
      }
  </code></pre>