well, actually tes.bin is an older version of tes2.bin files
they have exactly have same struct, except tes2.bin have more data in it's struct...
what i really want to do is actually upgrade tes.bin to tes2.bin
so i was hoping something like :
reading data from tes.bin and tes2.bin and assign the value to the struct
(it can be done by fread)
then assign value from tes.bin to tes2.bin
and use fwrite to rewrite tes.bin using tes2.bin struct but with tes.bin values in it...
so let say :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
struct tes
{
int a;
char c[64];
double d;
} old;
struct tes2
{
int a;
int b;
char c[64];
double d;
}new;
for example tes.bin have value
a=1;
c={'t','e','s'};
d=3.5;
while tes2.bin have :
a=3;
b=2;
c={'t','e','s'};
d=5;
then assigned value from old to new :
so it become :
a=1;
b=2
c={'t','e','s'};
d=3.5;
and rewrite old tes.bin
and i was hoping to use only 1 struct
|
well, if it's not possible, i'm very sorry to bother you guys :D
if anyone have any knowledge about this, even it's just a little hope for me, i would appreciate it :)