Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //modulo para cargar los viajes de un archio (loadLog)
- void loadLog(Lista &list,Trip &viaje,string &fichero){
- //string fichero;
- string km;
- string seg;
- string lit;
- string esp;
- char para;
- char cor;
- ifstream f(fichero.c_str());
- if(f.is_open()){ //si el fichero esta abierto
- borrarLista(list);
- string s="";
- while(f>>viaje.km && !f.eof()){
- f>>km;
- f>>viaje.time;
- f>>seg;
- f>>viaje.consumption;
- f>>lit;
- f>>para;
- f>>viaje.kminitial;
- f>>viaje.kmhv;
- f>>viaje.kmfinal;
- f>>esp;
- f>>cor;
- f>>viaje.tinitial;
- f>>viaje.thv;
- f>>viaje.tfinal;
- f>>cor;
- introducirDatos(list,viaje);
- }
- f.close(); //cerramos fichero
- }else{ //quiere decir que no se ha podido abrir el fichero
- cout<<"Error, can't open file"<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement