I have the following in the txt file
1 Single.Standard Standard Empty ......... ........ 70
2 Single Standard Empty ........ ....... 70
I ahve the code below buts its not deleting the selected id
while(!file.eof())
{
file >> roomnumber >> category >> type >> status >> datein >> dateout >> rate ;
data.setroominfo(roomnumber,category,type,status,datein,dateout,rate);
if(roomid!=data.getroomnumber())
{
fstream file3;
file3.open("temp.txt",ios::out|ios::app);
file3 << roomnumber << ' ' << category << ' ' << type << ' ' << status << ' ' << datein << ' ' << dateout << ' ' << rate << endl;
file.close();
file3.close();
}
remove("room.txt");
rename("temp.txt","room.txt");
cout<<"\nRoom has been removed";
break;
}