Vidyalelo
C Programming · Q130

Pointer

Programming · C Programming · question 130

Q130

What will be the output of the following C code? #include void main() char *a[10] = "hi", "hello", "how"; int i = 0, j = 0; a[0] = "hey"; for (i = 0;i < 10; i++) printf("%s ", a[i]);

A.
hi hello how Segmentation fault
B.
hi hello how followed by 7 null values
C.
hey hello how Segmentation fault
Answer
D.
depends on compiler

Answer: Option C

Solution

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