Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void dataPorFichero(tColeccionEmpleados &zara){
- ifstream file;
- char filename[50];
- cin.getline(filename, 50);
- file.open(filename);
- if(!file.is_open()){
- cerr << "The file is not open" << endl;
- exit(1);
- }
- int counter = 0;
- while(file.good()){
- file >> zara.listaEmpleados[counter].date.day;
- file >> zara.listaEmpleados[counter].date.month;
- file >> zara.listaEmpleados[counter].date.year;
- file >> zara.listaEmpleados[counter].dptmnt;
- file >> zara.listaEmpleados[counter].identifier;
- file >> zara.listaEmpleados[counter].salary;
- cout << "The identifier for this employe is: " << zara.listaEmpleados[counter].identifier << endl;
- cout << "The date this employe was registered is: " << zara.listaEmpleados[counter].date.day << " of " << zara.listaEmpleados[counter].date.month << " of " << zara.listaEmpleados[counter].date.year << endl;
- counter++;
- }
- file.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement