Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/26/83; site ihuxp.UUCP
Path: utzoo!linus!decvax!harpo!floyd!whuxlb!pyuxll!eisx!npoiv!npois!hogpc!houxm!hocda!spanky!burl!sb1!ll1!otuxa!we13!ihnp4!ihuxp!wyse
From: wyse@ihuxp.UUCP
Newsgroups: net.lang.c
Subject: Re: mixing pointers and arrays
Message-ID: <475@ihuxp.UUCP>
Date: Tue, 2-Aug-83 15:28:54 EDT
Article-I.D.: ihuxp.475
Posted: Tue Aug  2 15:28:54 1983
Date-Received: Thu, 4-Aug-83 01:40:13 EDT
References: <2332@csu-cs.UUCP>
Organization: BTL Naperville, Il.
Lines: 23

I suggest that you all reread section 5.3 in "The C Programming Language",
by our friends BWK and DMR.  Given that I have

	int a[10];

the reference a[i] is equivalent to *(a+i).  The difference between an array
name and a pointer is that the array name is a constant, i.e., you can't
assign to it.

When a array name is used as an argument to a function, the address of the
beginning of array is passed and as somebody else pointed out, it is
truly a pointer.  However, you can declare it in the function as
either
	char *s;
or
	char s[];
as they are equivalent and which one is used depends on how the expressions
involving s will be written in the function.

		Neal Wyse
		ihnp4!ihuxp!wyse
		Bell Labs, Naperville Ill.