Z
Zalek Bloom
I created a binary file with commands:
FILE * fStudent ;
Student s; // this is a class
fStudent = fopen("student.txt", "a+b") ;
cnt_w = fwrite(&s, sizeof(s),1,fStudent) ;
fclose(fStudent);
I wrote a few records and viewed the file - file was OK. Now I wanted
to rewrite some records. I positioned a file pointer on a specific
record and issued a fwrite command. When I displayed the rewritten
file I noticed that a specific records was not changed. Notning was
changed in the file.
My question:
can I rewrite some data in the middle of file using fwrite command?
If not - which command will allow me to rewrite data?
Thanks,
Zalek
FILE * fStudent ;
Student s; // this is a class
fStudent = fopen("student.txt", "a+b") ;
cnt_w = fwrite(&s, sizeof(s),1,fStudent) ;
fclose(fStudent);
I wrote a few records and viewed the file - file was OK. Now I wanted
to rewrite some records. I positioned a file pointer on a specific
record and issued a fwrite command. When I displayed the rewritten
file I noticed that a specific records was not changed. Notning was
changed in the file.
My question:
can I rewrite some data in the middle of file using fwrite command?
If not - which command will allow me to rewrite data?
Thanks,
Zalek