CBFalconer said:
Alright, if you insist, go ahead and make assignments to arrays. I
predict they won't work in C.
He knows that; he specifically acknowledged that arrays are not
assignable.
Note that a struct or union actually
defines a new type, an array only defines an aggregate of an old
type.
Structs, unions, and arrays are all aggregates defined in terms of
existing types. The standard referss to struct, union, array, and
function types as "derived types" in C99 6.2.5.
An array type is certainly a type. It's probably not a "first-class"
or "fundamental" type, because, among other things, it doesn't support
assignment or comparison, but C doesn't talk about "first-class" or
"fundamental" types. Structures can be assigned and arrays can't, but
C doesn't make any strong fundamental distinction between them on that
basis; they just happen to support different sets of operations.
C99 6.2.5p21:
Arithmetic types and pointer types are collectively called _scalar
types_. Array and structure types are collectively called
_aggregate types_.
and a footnote:
Note that aggregate type does not include union type because an
object with union type can only contain one member at a time.
(So can a single-element structure, but that's not a big deal; most
references in the standard to "aggregate types" talk about "aggregate
or union" types.)