I got a series of functions that are connected too eachother, and that write in a certain data file, but when I look into the data file, the data entered isnt where it is supposed too be! it always writes itself in the back of the file
this is the code:
Code:
std::ofstream WriteIt ("C:\Datacab.dat", ios::app | ios::binary );
WriteIt.seekp ( ( (Location)* sizeof (member) ), ios::beg );
std::cout <<"location in bytes: "<< (Location)* sizeof (member) << std::endl;
WriteIt.write ( ( reinterpret_cast < char * > (&Wthis) ),sizeof (member) );
I am 100% sure that somthin is wrong RIGHT THERE since this is what i got as output checking:
Code:
Location: LOOP -> 1
Registered!!
location in bytes: 0
wheras Location represents the times looped untill the place is found where the data must written, we do minus 1 (-1) to get the exact location in the file that needs too be overwritten. this is shown by : location in bytes -> 0
but it just doesnt write there! help?!
instead it just allways APPENDS on the back of the file, increasing it size too!! which isnt what i want