You are on page 1of 1

string get_r()

{
return r;
}
void del_car(string b)
{
vehicle del,s;
bool a=true;
fstream data;
fstream temp;
data.open("cararival.dat",ios::in| ios::binary);
if(!data)
{
system("cls");
cout<<"\n";;
cout<<"\n"<<endl;
cout<<"\t\t\t** File not Found **";
}
else
{
temp.open("temp.dat",ios::out|ios::binary);
while(data.read((char*)&del, sizeof(del)))
{
if (del.get_r()!=b)
{
temp.write((char*)&del, sizeof(del));
}
else
a=false;
}
if(a)
{
cout<<"\n";
cout<<"\t\t\t ** Enter Reg No **";
}
data.close();
temp.close();
remove("cararival.dat");
rename("temp.dat","cararival.dat");
}
if(j==1)
{
vehicle b;
string c;
system("cls");
cout<<"Enter Reg :";
cin>>c;
b.del_car(c);
system("cls");
}

You might also like