Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. How large is the Person struct on a 32-bit machine? a)36 bytes b)38 bytes c)4

ID: 670244 • Letter: 1

Question

1. How large is the Person struct on a 32-bit machine?

a)36 bytes

b)38 bytes

c)40 bytes

d)42 bytes

2. Which of the following is equal to y->id?

a)&y->id

b)&x.id

c)x.id

d)*x->id

3. Which of the following is a valid replacement for line 7?

a)scanf(“%c”, &x->gender);

b)scanf(“%c”, &((*y).gender));

c)scanf(“%c”, x.gender);

d)scanf(“%s”, &y->gender);

4. If we input “Greg” for the name. What is the value of

*(y->name)?

a)The address of the array containing “Greg”

b)‘G’

c)The address of y

d)Undefined

5. What is the type of (&*y->name)?

a)char

b)struct Person*

c)char**

d)char*

Could u help me to solve these questions?

#include stdio.h #pragma warning(disable : 4996) Accessing Members of a Struct struct Person int id; char name [30]; char gender; // need padding? int main() f 1 2 4 5 6 7 8 9 y = &x; scanf("%d", &(y->id)); printf("%din.. , x.id); scant( "%s'. , (*y).name); printf("%s ", (8x)-name); fflush (stdin); x,gender = get char(); printt ntfCXc ", y-gender): return 0;

Explanation / Answer

1) 36 bytes

2) x.id

3) scanf(“%c”, x.gender);

4)Undefined

5)char**