Array parameters

Doug Gwyn (VLD/VMB) gwyn at Brl-Vld.ARPA
Wed Jan 9 00:07:21 AEST 1985


No, arrays cannot be passed as actual arguments to a function
but only their addresses.
	function( a ) int a[5][6]; { ... }
has just one pointer datum passed to it, not 30 ints.  The difference
is significant; due to C's "pass-by-value" design, in the actual case
"function" can modify the caller's array while in the incorrect case
(entire array as argument) it could only modify its own local copy of
the array.



More information about the Comp.lang.c mailing list