Addresses of parameters

Richard Harter g-rh at XAIT.Xerox.COM
Mon Oct 31 06:29:26 AEST 1988


In article <10164 at haddock.ima.isc.com> karl at haddock.ima.isc.com (Karl Heuer) writes:
>In article <35664 at XAIT.Xerox.COM> g-rh at 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.



More information about the Comp.lang.c mailing list