What are the trade-offs between name type equivalence and structure type equivalence?
Suppose if there is the statement
a = b means the data in the object of 'b' transferred into the object 'a'. only if the type of the object is same, the two object are same type or not is only understand in two ways i.e name type equivalence and structure type equivalence.
Name type equivalence : (If and only if they have the same name)
for an example :
typedef struct
{
int a[200];
int c;
} Queue;
typedef Struct
{
int a[200];
int c;
} Sashi;
Queue m, n;
Sashi p, q;
Suppose if the name equivalence is used then
m = n; // is Valid
p = q; // is Valid
But
m = p; // is not Valid (Because its name equivalence is not same)
Structure type equivalence : (if and only if they have the same structure)
The example that is listed above
m = p // This will be valid because it has the same structure type
But we have to remember that the c does not support the structure type equivalence
Get Answers For Free
Most questions answered within 1 hours.