Page 446 - C++
P. 446
{
flag=1;
}
else
{
fout.write((char*)&S,sizeof(S));
}
}
if(flag==1)
{
S.SGetdata();
fout.write((char*)&S,sizeof(S));
cout<<"\nYour record has been modified :)";
}
if(flag==0)
{
cout<<"\nNo record found";
}
fin.close();
fout.close();
remove("schedule.dat");
rename("schtemp.dat","schedule.dat");
}
/*************************************************************/
void sch_view()
{
Schedule S;
Date d;
int flag=0;
ifstream fin("schedule.dat",ios::in|ios::binary);
cout<<"\nEnter the date & time of that schedule which you want to
view "
<<"\nDay = ";
cin>>d.dd;
cout<<"\nMonth = ";
cin>>d.mm;
cout<<"\nYear = ";
cin>>d.yy;
while(fin.read((char*)&S,sizeof(S)))
{
if(S.check_dt(d))
{
S.SDisplaydata();
flag=1;
}
}
if(!flag)
{
cout<<"\nNo record found ";
}
getch();
}
/*************************************************************/
void front()