From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Pointers and DJGPP Date: Thu, 19 Mar 1998 19:12:45 -0500 Organization: Two pounds of chaos and a pinch of salt. Lines: 19 Message-ID: <3511B47D.2A18@cs.com> References: <3510449E DOT AE294519 AT ipass DOT net> <1998031920482900 DOT PAA25149 AT ladder01 DOT news DOT aol DOT com> NNTP-Posting-Host: ppp210.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Zoey4Pres wrote: > > On the other hand, he could have used realloc and preserved the form of his > original function. > > s = (char *)realloc ... Two problems here. First, since the original variable is an automatic array, not a pointer, you can't realloc() it. Second, since it is passed by value, changing it in mstrcat() would not apply that change to the original variable. -- --------------------------------------------------------------------- | John M. Aldrich | "Autocracy is based on the assumption| | aka Fighteer I | that one man is wiser than a million | | mailto:fighteer AT cs DOT com | men. Let's play that over again, | | http://www.cs.com/fighteer | too. Who decides?" - Lazarus Long | ---------------------------------------------------------------------