Is array a data type in c ? If yes can we create variables of array type as in structures, enum .
int arr[10] ;//is this arr is a data type of 10 ints
Arrays are a derived type
, if we look at the C99 draft standard section 6.2.5
Types paragraph 20 says(emphasis mine):
Any number of derived types can be constructed from the object, function, and incomplete types, as follows:
— An array type describes a contiguously allocated nonempty set of objects with a particular member object type, called the element type.36) Array types are characterized by their element type and by the number of elements in the array. An array type is said to be derived from its element type, and if its element type is T, the array type is sometimes called ‘‘array of T’’. The construction of an array type from an element type is called ‘‘array type derivation’’.
You can create arrays of structures and enums, the only exception is noted in footnote 36:
Since object types do not include incomplete types, an array of incomplete type cannot be constructed.