Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!oddjob!mimsy!umd5!umbc3!dipto From: dipto@umbc3.UMD.EDU (Dipto Chakravarty ) Newsgroups: comp.lang.c Subject: how to write a function that returns a string of N nulls Message-ID: <507@umbc3.UMD.EDU> Date: Mon, 19-Oct-87 16:09:05 EDT Article-I.D.: umbc3.507 Posted: Mon Oct 19 16:09:05 1987 Date-Received: Tue, 20-Oct-87 21:48:56 EDT Reply-To: dipto@umbc3.umd.edu (Dipto Chakravarty (CMSC)) Organization: University of Maryland, Baltimore County Lines: 16 I have a prog that takes two parameters. The first one is a port and the second is an integer that specifies the length of the string to be sent to this port. If N=4 then I have to send a "\0\0\0\0" to the port. How can I write a function that will take N as a parameter and return a string _out (which consists of N "\0"s to my main(). And secondly what form of fprintf or fwrite do I use to print out the string from the main. The function itself can handle the output of the string if passing it as parameter is messsy. Thanks in advance Dipto Chakravarty dipto@umbc3.umd.edu.ARPA