60 391
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #57124 in C++ for Eman

Question #57124
how to delete a record from a txt file,I have been created the function but it doesn't work correctly
the function as following:
void DeleteRecord()
{
ReadRecord(); //for the function which I created to read a file
for(int i=0;i<counter;i++)
{
cout<< IDNum[i]<<"\t"<<FullName[i]<<"\t"<<LastName[i]<<"\t"<<phone[i]<<"\t"<<Nationality[i]<<endl;
}
int Id;
int num;
int c=0;
int index=-1;
cout<<"please enter the Id number to be deleted"<<endl;
cin>>Id;
int i;
for ( i=0; i<counter;i++)
{
if ( IDNum[i]==Id)
IDNum[i]==-1;
else
cout<<"ID not valid"<<endl;


}
so please I just want to fix this error

Regards,
Eman
Expert's answer

Not answered

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions