Pointers/arrays (harvard.215)

bet at ecsvax.UUCP bet at ecsvax.UUCP
Sun Apr 15 02:54:56 AEST 1984


When an array is passed as an argument to a function, the (local) formal
parameter is filled with a pointer to the array. Thus the declarations

	f(array)
	char array[];
	{
		...

and
	f(ptr)
	char *ptr;
	{
		...

both actually declare character pointers as arguments. Since the syntax
of array reference and pointer offset/dereference are identical, that's O.K.
Since the argument is actually a pointer either way, auto-increment and
auto-decrement operators are also fine.
					Bennett Todd
					...{decvax,ihnp4,akgua}!mcnc!ecsvax!bet



More information about the Comp.lang.c mailing list