Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!papaya.bbn.com!rsalz From: rsalz@bbn.com (Rich Salz) Newsgroups: comp.lang.c Subject: Re: how to write a function that returns a string of N nulls Message-ID: <213@papaya.bbn.com> Date: Mon, 19-Oct-87 22:34:34 EDT Article-I.D.: papaya.213 Posted: Mon Oct 19 22:34:34 1987 Date-Received: Wed, 21-Oct-87 00:52:26 EDT References: <507@umbc3.UMD.EDU> <206@PT.CS.CMU.EDU> Reply-To: rsalz@papaya.bbn.com (Rich Salz) Organization: BBN Laboratories, Cambridge MA Lines: 16 If the ultimate goal is to write "N" ASCII NUL characters, then: #include void putnul(n, f) register int n; register FILE *f; { while (--n >= 0) (void)putc('\0', f); } If the intermediate goal of getting a buffer of "N" zero-filled bytes is also important, then look up calloc(3), bstring(3) and/or memory(3). /r$ -- For comp.sources.unix stuff, mail to sources@uunet.uu.net.