Near the top of my code I have
Code:
ifstream accfile;
And I have been using accfile to open, read and close files several times in the code. However, I am not receiving an error with the following code
Code:
           else
             {
               accfile.open ("loans.txt");
               accfile << name << ";";
             }
         }
       cout << "enter the ID number of the book." << endl;
       string book;
       accfile << book << endl;
       accfile.close();
       break;
     case 3:
My errors (line 179 - accfile << name << ";"

testfile.cc:179: no match for `ifstream & << string &'
/usr/local/depot/gcc-2.95.3/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/../../../../include/g++-3/std/bastring.cc:469: candidates are: class ostream & operator <<<char, string_char_traits<char>, __default_alloc_template<false,0> >(ostream &, const basic_string<char,string_char_traits<char>,__defau lt_alloc_template<false,0> > &)
testfile.cc:184: no match for `ifstream & << string &'
/usr/local/depot/gcc-2.95.3/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/../../../../include/g++-3/std/bastring.cc:469: candidates are: class ostream & operator <<<char, string_char_traits<char>, __default_alloc_template<false,0> >(ostream &, const basic_string<char,string_char_traits<char>,__defau lt_alloc_template<false,0> > &)
testfile.cc:186: break statement not within loop or switch
testfile.cc:187: case label `3' not within a switch statement
testfile.cc:183: warning: destructor needed for `class string book'
testfile.cc:187: warning: where case label appears here
testfile.cc:187: warning: (enclose actions of previous case statements requiring
testfile.cc:187: warning: destructors in their own binding contours.)
testfile.cc:187: confused by earlier errors, bailing out