【 在 viogus@smth.org-SPAM.no (风之精灵*全力搞好听涛) 的大作中提到: 】
: while (fread(&bh, sizeof(struct userec1), 1, fp)) {
: memset(&bhnew, 0, sizeof(struct userec2));
: memcpy(&bhnew, &bh, sizeof(struct userec1));
我ft,这样一搞不就全乱套了嘛!当然要一项一项依次赋值了。你那个结构好前面
就多了一个title项,memcpy了当然就后面的项全都错位了。
: bhnew.userdefine[1] = -1;
: bhnew.notedate = bh.notedate;
: bhnew.noteline = bh.noteline;
: bhnew.notemode = bh.notemode;
: bhnew.exittime = bh.exittime;
: bhnew.usedspace = bh.usedspace;
: fwrite(&bhnew, sizeof(struct userec2), 1, fp2);
: : ...................
--