I'm reading about Type Equivalence in my Programming Languages class and I've come across a situation in C I'm unsure about.
It describes C's "Type Equivalence" as:
C uses a form of type equivalence that falls between name and structural equivalence, and which can be loosely described as "name equivalence for structs and unions, structural equivalence for everything else."
So what if I have two arrays of different size, but the same base type:
typedef int A1[10];
typedef int A2[20];
Since all I need is structural equivalence, could these two be considered structurally equivalent? In C, is the size of the index set part of an array type or no?
No they are not.
You can try
sizeof(A1)
andsizeof(A2)
and see that they are different.