//programming by a. najafzadeh 1384/01/10 #include #include #include #include #include #include void ti_auto_set(long int); void ti_auto_man(long int); void ti_auto_see(long int); struct tim_set { unsigned long int hh; unsigned long int mi; unsigned long int se; unsigned long int hu; }ts; struct time t; int main() { register long int number1 , da; clrscr(); cout<<"typ 1 and press enter for auto time setting\n"; cout<<"typ 2 and press enter for manual time setting\n"; cout<<"type 3 and press enter for see the list of times\n"; ifstream aam("coun/coun.dat"); if(!aam) { cout<<"file not found"; getch(); exit(0); } aam>>da; aam.close(); cin>>number1; cin.get(); if(number1 == 1) ti_auto_set(number1); if(number1 == 2) ti_auto_man(number1); if(number1 == 3) ti_auto_see(number1); getch(); return 0; } //func ti_auto_set 1111111111111111111111111111111111111111111111111111111111111 void ti_auto_set(long int) { ofstream as("tim1.dat" , ios::app); if(!as) { clrscr(); cout<<"file not found"; getch(); exit(0); } gettime(&t); ts.hh = ("%2u" , t.ti_hour); ts.mi = ("%2u" , t.ti_min); ts.se = ("%2u" , t.ti_sec); ts.hu = ("%2u" , t.ti_hund); as.write((char *) &ts , sizeof(struct tim_set)); clrscr(); as.close(); cout<<"time is set"; } //func void ti_auto_man(int number1) 2222222222222222222222222222222222222222222 void ti_auto_man(long int) { cout<<"\nfunc2"; } //func ti_auto_see 3333333333333333333333333333333333333333333333333333333333333 void ti_auto_see(long int) { long int row = 3 , a = 5 , b = 20 , mm = 3 , date_1 = 1 , date_2 = 1; clrscr(); cout<<" ENTER TIME EXIT TIME time time kol\n"; cout<<"============================================================"; ifstream as1("tim1.dat"); if(!as1) { clrscr(); cout<<"file not found"; getch(); exit(0); } while(as1.read((char *) &ts , sizeof(struct tim_set))) { if(date_2 <= 20) { if((mm % 2) == 0) gotoxy(b , row); else gotoxy(a , row); cout<