Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main (void){
- banner();
- int i, k, selection, switchN = 0;
- cstring title [] = {"See Appointment" ,"Delete Appointment", "Archive Appointments", "Exit" };
- date* D;
- Family familyList;
- familyList.print();
- ToDo list(&familyList);
- for( i = 0; i<2; ++i)
- {
- list.addappt(appointment::makeAppt(&familyList));
- }
- cout << "\n" << list << "\n"; //seems to be crashing here
- }
- ToDo::ToDo(Family* x)
- {
- time_t incDate;
- char incName [30];
- struct tm tmpTime;
- appointment* a;
- vector <person*> tmp;
- person* tmpPerson;
- ofstream stream;
- int k, j;
- //------------------------
- head = NULL;
- scan = NULL;
- follow = NULL;
- ifstream myFile( "appts list" );
- cout << "\nFile Opened\n";
- myFile >> incName >> incDate;
- char* tempTime = ctime( & incDate );
- cout << tempTime;
- tmpTime = *localtime( & incDate );
- cout << "\n------------------------------\n"
- << "Date is being constructed from file....\n";
- date D(incDate, tmpTime);
- tmp = x->getArray(); //accesses vector in Famiily class
- for(k = 0; k < tmp.size(); ++k ){ //loop to located correct person in vector
- j = strcmp(incName, tmp[k]->getName());
- if( j == 0){
- tmpPerson = tmp[k];
- }
- }
- cout << "\n----------------------------------\n"
- << "Appointment being created from file....\n";
- a= new appointment (&D, tmpPerson);
- /*cout << A;*/
- cout << "ToDo Built\n";
- addappt(a);
- print(stream);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement