Question: Given the C code below, which C statement is legal? struct person { struct { float height, weight; int age; char * name; } b;

Given the C code below, which C statement is legal?
struct person {
struct {
float height, weight;
int age;
char *name;
} b;
union {
struct {
int grade, room;
} teacher;
float gpa;
} u;
enum {TCHR, STDNT} kind;
} p;
Group of answer choices
p.u.kind = TCHR;
p.height =50.5f;
None of the other answers are legal.
p.u.teacher.room =5;
p.b.gpa =3.4f;

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!