Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ofstream fout;
- int demon = sizeof(demo);
- fout.open(path, ios_base::trunc | ios::binary);
- int i = 0;
- while (i < 3)
- {
- fout.write((char*)&demo[i], demon);
- ++i;
- }
- fout.close();
- ifstream fin;
- fin.open(path, ios::beg | ios::binary);
- worker* buf = new worker[3];
- i = 0;
- while (i < 3)
- {
- fin.read((char*)&buf[i], demon);
- cout << buf[i].name << " " << buf[i].detailsOnMonday << " " << buf[i].detailsInTuesday << " " << buf[i].detailsInWednesday << " " << buf[i].detailsInThursday << " " << buf[i].detailsOnFriday << " " << buf[i].detailsOnSaturday << endl;
- ++i;
- }
- fin.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement