Hi, guys. I have another problem which have been trying to solve without any solution for more than a month.
I am doing a simple database program using the struct data structure. I managed to do add, delete, search and display the records entered without any problems but when it comes to edit, sometimes (and sometimes only!) I have problem after writing the edited record back to database.
I use fread to read each record and if there is a match, there will be a menu to ask which data in a record needed to be edited.
However, using fwrite to saved back the edited file, my edited record have some bytes missing from the record.
e.g.
Book Title: ed Dragon (which is suppose to be Red Dragon)
Book Author: homas Harris (suppose to be Thomas harris)
You get the picture. Seemed to me that, the position of the pointer is off by 1 byte.
Does anyone have this problem before? Could it be a compiler problem? I am using Visual C++ Professional on a Windows XP Pro machine.
Sorry for not providing the codes because it is very long.
Thanks in advance,
Darryl
I am doing a simple database program using the struct data structure. I managed to do add, delete, search and display the records entered without any problems but when it comes to edit, sometimes (and sometimes only!) I have problem after writing the edited record back to database.
I use fread to read each record and if there is a match, there will be a menu to ask which data in a record needed to be edited.
However, using fwrite to saved back the edited file, my edited record have some bytes missing from the record.
e.g.
Book Title: ed Dragon (which is suppose to be Red Dragon)
Book Author: homas Harris (suppose to be Thomas harris)
You get the picture. Seemed to me that, the position of the pointer is off by 1 byte.
Does anyone have this problem before? Could it be a compiler problem? I am using Visual C++ Professional on a Windows XP Pro machine.
Sorry for not providing the codes because it is very long.
Thanks in advance,
Darryl