Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!rutgers!att!cbnewsh!rkl From: rkl@cbnewsh.ATT.COM (kevin.laux) Newsgroups: comp.lang.c Subject: Re: strncpy question Message-ID: <545@cbnewsh.ATT.COM> Date: 11 May 89 15:58:06 GMT References: <630@babbage.acc.virginia.edu> Distribution: na Organization: AT&T Bell Laboratories Lines: 18 In article <630@babbage.acc.virginia.edu>, pts@watt.acc.Virginia.EDU (Paul T. Shannon) writes: } I have a question on the strncpy library function. (The same question applies to } strcpy as well.) This program fragment seems to be the recommended usage: } [deleted fragment] } } Why is this function written so that the pointer to the destination string is } both } 1. passed as an argument to the function, and } 2. returned by the function? } The return of the destination pointer allows for the function to be passed as an argument to other functions, as in: printf (" %s\n", , strncpy (dest, src, count)); --rkl