Question: a. Given the C declarations struct{ int i; double j; } x, y; struct{ int i; double j; } z; the assignment x = z
a. Given the C declarations
struct{
int i;
double j;
} x, y;
struct{
int i;
double j;
} z;
the assignment x = z generates a compilation error, but the assignment x = y does not. Why?
b. Give two different ways to fix the code in part ( a) so that x = z works. Which way is better and why?
Step by Step Solution
There are 3 Steps involved in it
To understand and solve this problem we need to delve into certain aspects of C programming related to structures and type compatibility Part a Explan... View full answer
Get step-by-step solutions from verified subject matter experts
