如何存储一个数组内部连续的几个元组到文件中?
我用下面的语句开辟了一个数组空间,然后对这个数组进行了赋值
DTree* dt = (DTree*)malloc(1024* sizeof(struct DirectTree));
我将如何将数组中连续的一段存入文件中呢,(注意:是一次性写入,而不是一条一条写入)
我用下面的方法写入从di,不行;
DTree *dt_ptr;
dt_ptr = &dt[i];
fwrite(dt_ptr, j * sizeof(struct DirectTree), 1, fp);