Vidyalelo
C Programming · Q59

Structure and Union

Programming · C Programming · question 59

Q59

What will be the output of the following C code? #include struct p char *name; struct p *next; ; struct p *ptrary[10]; int main() struct p p; p.name = "xyz"; p.next = NULL; ptrary[0] = &p; printf("%s ", ptrary[0]->name); return 0;

A.
Compile time error
B.
Segmentation fault
C.
Undefined behaviour
D.
xyz
Answer

Answer: Option D

Solution

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