/* This program or library is part of amv::software. Copyright (C) 1995-2007 Ariel Alonzo Medina Vázquez This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, visit http://www.gnu.org/licenses/lgpl.html or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Ariel Alonzo Medina Vázquez ariel_medina21@hotmail.com http://www.paginasprodigy.com/campechedigital/arielmedina1978 Campeche, Campeche, México */ #include #include #include using namespace std; class book { string name, author, isbn; public: friend istream &operator>>(istream &is, book &b) { char s[1024]; if(&is==&cin) std::cerr<<"Nombre del libro: "; if(is.getline(s,1024)) b.name=s; if(&is==&cin) std::cerr<<"Autor: "; if(is.getline(s,1024)) b.author=s; if(&is==&cin) std::cerr<<"ISBN: "; if(is.getline(s,1024)) b.isbn=s; return is; } friend ostream &operator<<(ostream &os, const book &b) { if(&os==&cout) std::cerr<<"Nombre del libro: "; os<>b; ofstream os("libros.txt",ios::out|ios::app); os<>b) cout<