Question: In Ada the equality test (x = y in Ada syntax) is legal for all types, as long as x and y have the same

In Ada the equality test (x = y in Ada syntax) is legal for all types, as long as x and y have the same type. In C, however, the equality test (x == y in C syntax) is only permitted for variables of a few types; however, the types of x and y need not always be the same.

(a) Describe the types of x and y for which the C comparison x == y is legal.

(b) Why does the C language not allow equality tests for variables of certain types?

(c) Why does the C language allow comparisons between certain values of different types?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!