append mode ("a") query
Ray Wallace
wallace at oldtmr.dec.com
Wed Feb 14 06:13:30 AEST 1990
In article <4983.25d7e9db at uwovax.uwo.ca>, chet at uwovax.uwo.ca writes...
>(i.e. the 2nd ten lines are inserted before the EOF mark), but program B
>positions its appends after the EOF mark (so that they don't appear when
>the file is typed out)? And what I can do to fix B. This happens on
It looks to me like you need to add the line
fprintf(fp, "%s\n", entry);
to your add_subentry() function, and remove the fprintf() from the end of your
main() function.
As it was posted program B only writes to the file once, at the end of main()
it writes out your "semantic_field".
---
Ray Wallace
(INTERNET,UUCP) wallace at oldtmr.enet.dec.com
(UUCP) ...!decwrl!oldtmr.enet!wallace
(INTERNET) wallace%oldtmr.enet at decwrl.dec.com
---
More information about the Comp.lang.c
mailing list