Vidyalelo
C Programming · Q60

Structure and Union

Programming · C Programming · question 60

Q60

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 ", p->name); return 0;

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

Answer: Option A

Solution

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