Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //constructor that realizes date and person info from appts.txt and creates an appointment list------------
- ToDo::ToDo(Family* famList)
- {
- numCells = 0; head = NULL; scan = NULL; follow = NULL;
- cout << "\nCreating ToDo...\n";
- cout << "\nChecking for appts.txt file...\n";
- ifstream apptFile("c:\\appts.txt");
- if(apptFile.is_open())
- {
- cout << "\nFile found.\n";
- cout << "\nRealizing appt.txt...\n";
- for(int k = 0;! apptFile.eof();++k)
- {
- time_t time;
- char s1[SHRTNAME];
- Appointment* a;
- apptFile >> time;
- apptFile >> s1;
- Date d(time);
- Person p = famList->search(s1);
- a = new Appointment(&p, d);
- cout << "\nAdd appt...\n";
- addAppt(a);
- print(cout);
- }
- }
- else
- cout << "\nFile not found.\n";
- apptFile.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement