Well, all you really needed to do was to take the existing (working) code and cut+paste it into your new functions. Very minor changes would be required that way.
As it is, the latest code seems to have taken several steps backwards. For example here:
Lines 89 to 92 look pretty much like an infinite loop to me.
And just picking another line from the code here, line 105:
and the value returned by
are integers, so why they would be compared as c-strings is beyond me.
Just taking a step back for a moment, to an earlier version:
There was an error I overlooked. At line 105:
cout<<"Enter The Item Number To Modify : "<<endl;
while(fio.read((char*) &i ,sizeof(i)))
fio.read((char*) &i ,sizeof(i)); // this line is not needed
The file is being read twice in the loop, once as part of the while condition, and again in the body of the loop. The second read (at line 105) is not needed.