Vidyalelo
C Programming · Q179

Structure and Union

Programming · C Programming · question 179

Q179

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->ptr->x); return 0;

A.
Compile time error
B.
Segmenation fault
C.
Undefined behaviour
D.
1
Answer

Answer: Option D

Solution

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