Consider the following type declarations in a fictitious language. I. Type Equiv
ID: 3704155 • Letter: C
Question
Consider the following type declarations in a fictitious language.
I. Type Equivalence. Consider the following type declarations in a fictitious language. TYPE // integer // boolean Al int; A2 bool; A3 pointer to float; A4 pointer to int; A5 pointer to bool; A6 pointer to Al; A7 : pointer to A2; A8 structure x int; A9structure a : int; A10 structure : float; h All structure a : int ;b float; h A12 : structure { b float; a : int ; } A13 structure fx: Al ; b float; h A14 structurex: bool b : int; A15 structure fx: A2; b Al; ) A16 func x int int; A17 func x : float int; A18 func x : int, y : int int; // A19 is a function that takes two parameters and return int. The first // paraeter is a function that takes two int as parameters and return int // and second second parameter is int A19 func x A18, int) int; A20 func x func (int, int) int, int) int; A21 func x : func (int, float) int, int) int; A22 func x func (int, int) float, int) int; A23 structure fa: pointer to A24; b : pointer to A23; h A24 structure fa: pointer to A23; b pointer to A24; h A25 structure fa pointer to A26; b : A19; c A20; A26 structure fa: pointer to A25; bA20; c : A19; h A27 array [4][5] of A25; A28 array [4][5] of A26; A29 array [5]14] of A26; // function of int that returns int // function of float that returns int // array 4 rows 5 columnsExplanation / Answer
1)
1.a All the pointers are type equivalent
1.b A18,A19,A20,A21 are equivalent
1.c A8, A9
A11,A12,A13
A14,A15
A23,A24
A25,A26
A27,A28
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.