Is typedef char BUFFER[20] legal?

Blair P. Houghton bhoughto at pima.intel.com
Mon Feb 11 08:29:25 AEST 1991


In article <16562 at crdgw1.crd.ge.com> volpe at camelback.crd.ge.com (Christopher R Volpe) writes:
>In article <23128 at netcom.COM>, avery at netcom.COM (Avery Colter) writes:
>|>(Array names are not strictly objects, right? Like a pointer, a direct
>|> reference to it yields an address value, but unlike a pointer the
>|> array name's value itself cannot be changed.)

Perfect.

>Actually, array names do in fact refer to objects, that is, they are
>unmodifiable lvalues.

As long as we understand that referring to an object (in
this case unambiguously) and being an object are two
different things.

Pointers, arrays, structs, and unions are called "derived
types" by the ANSI standard[*].  They can refer to object
types, but can not be used in the same ways object types
can be used (and vice-versa; e.g., you can't apply the '.'
or '->' operators to an int).

[*] functions are also derived types, but do not refer to
objects.  (See sec. 3.1.2.5, Types, ANSI X3.159-1989.)

				--Blair
				  "After about ten years of this,
				   you'll be able to egrep my refs
				   to the std and sort|cat them into a
				   complete copy...it's the 'ten years'
				   part that scares most people."



More information about the Comp.lang.c mailing list