Vidyalelo
C Programming · Q72

Structure and Union

Programming · C Programming · question 72

Q72

What will be the output of the following C code? #include typedef struct p *q; struct p int x; char y; q ptr; ; int main() struct p p = 1, 2, &p; printf("%d ", p.ptr->x); return 0;

A.
Compile time error
B.
1
Answer
C.
Undefined behaviour
D.
Address of p

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board