[TUHS] v7 K&R C

Larry McVoy lm at mcvoy.com
Fri May 15 03:21:07 AEST 2020


On Wed, May 13, 2020 at 08:42:55PM -0400, John P. Linderman wrote:
> I never liked call by reference. When I was trying to understand a chunk of
> code, it was a great mental simplification to know that whatever a called
> routine did, it couldn't have an effect on the code I was trying to
> understand except through a returned value and (ghastly) global variables.

Call by value is fine for things like a single integer or whatever.  When
you have some giant array, you want to pass a pointer.

And "const" helps a lot with indicating the subroutine isn't going to
change it.


More information about the TUHS mailing list