Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site tymix.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!glacier!oliveb!tymix!kanner From: kanner@tymix.UUCP (Herb Kanner) Newsgroups: net.lang.c Subject: Re: c types problem Message-ID: <612@tymix.UUCP> Date: Wed, 8-Jan-86 17:18:22 EST Article-I.D.: tymix.612 Posted: Wed Jan 8 17:18:22 1986 Date-Received: Fri, 10-Jan-86 23:33:57 EST References: <870@kuling.UUCP> <168@hadron.UUCP> <175@hadron.UUCP> <1237@gitpyr.UUCP> Reply-To: kanner@tymix.UUCP (Herb Kanner) Organization: Tymnet Inc., Cupertino CA Lines: 23 In article <1237@gitpyr.UUCP> ken@gitpyr.UUCP (Ken Hall) writes: >May I ask a stupid question? Would somebody post or send me a very short >C program that open a file, write something to it, then closes it? > >Thankyou in advance. #include main() { FILE *file; filex = fopen("THING", "w"); /* opens file named THING for writing */ putc('a', filex); /* puts char 'a' in file pointed to by 'filex' */ fclose(filex); /* not necessary; end of program closes file */ } -- Herb Kanner Tymnet, Inc. ...!hplabs!oliveb!tymix!kanner