Open GoogleCodeExporter opened 9 years ago
void AppendAnnouncement(structAnnouncement *p, int count)
{
FILE *fp = NULL;
if ((fp = fopen("C:\\Giggs\\Project\\CWD3\\GFC\\DB\\Debug\\xat.db", "ab+")) == NULL)
{
printf("Can't open file.\n");
return;
}
fseek(fp, - sizeof(int), SEEK_END); //SEEK_END
int len = 0;
fread(&len, sizeof(int), 1, fp);
printf("%d\n", len);
len = 138;
fseek(fp, 0, SEEK_CUR);
size_t t = fwrite(&len, sizeof(int), 1, fp);
printf("%d\n", t);
fseek(fp, - sizeof(int), SEEK_END); //SEEK_END
fread(&len, sizeof(int), 1, fp);
printf("%d\n", len);
//fseek(fp, 0L, SEEK_END);
//fwrite(p, sizeof(structAnnouncement) * count, 1, fp);
/**/
/*
int len = 138;
fseek(fp, - sizeof(int), SEEK_END); //SEEK_END
fwrite(&len, sizeof(int), 1, fp);
*/
/*
fseek(fp, - sizeof(int), SEEK_END); //SEEK_END
int len = 0;
fread(&len, sizeof(int), 1, fp);
printf("%d\n", len);*/
fclose(fp);
}
Original comment by Giggs...@gmail.com
on 6 Sep 2013 at 9:48
Original issue reported on code.google.com by
Giggs...@gmail.com
on 19 Jun 2013 at 3:56