Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!seismo!sundc!pitstop!sun!amdcad!ames!mailrus!cwjcc!tut.cis.ohio-state.edu!husc6!xait!g-rh From: g-rh@XAIT.Xerox.COM (Richard Harter) Newsgroups: comp.lang.c Subject: Re: Addresses of parameters Message-ID: <35868@XAIT.Xerox.COM> Date: 30 Oct 88 20:29:26 GMT Article-I.D.: XAIT.35868 References: <35620@XAIT.Xerox.COM> <10124@haddock.ima.isc.com> <35664@XAIT.Xerox.COM> <10164@haddock.ima.isc.com> Reply-To: g-rh@XAIT.Xerox.COM (Richard Harter) Organization: Xerox Corporation, Cambridge, Massachusetts Lines: 29 In article <10164@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >In article <35664@XAIT.Xerox.COM> g-rh@XAIT.Xerox.COM (Richard Harter) writes: >Your reasoning raises a couple of other questions. Do you ever change the >value of a parameter variable, or do you treat it as a constant? Sometimes I do change the value. I never [:-)] write code without basing it in a paradigm or model of construction. In the most common model parameters represent fixed inputs, outputs to be returned, and values to be updated. The latter two categories are conveniently handled with pointers, again unchanged. [I never pass or return structures.] However there is a situation in which it is natural to alter a parameter value, that being when the parameter is the principle value in the main control loop. Thus process_node (s) node *s; { while (s) { ... code operating on node s = s->link; } } >Do you ever declare a formal parameter with the "register" keyword? Surely you jest! -- In the fields of Hell where the grass grows high Are the graves of dreams allowed to die. Richard Harter, SMDS Inc.