Vidyalelo
C Programming · Q206

Pointer

Programming · C Programming · question 206

Q206

What will be the output of the following C code? #include void foo(int (*ary)[3]); int main() int ary[2][3]; foo(ary); void foo(int (*ary)[3]) int i = 10, j = 2, k; ary[0] = &i; ary[1] = &j; for (k = 0;k < 2; k++) printf("%d ", *ary[k]);

A.
Compile time error
Answer
B.
10 2
C.
Undefined behaviour
D.
segmentation fault/code crash

Answer: Option A

Solution

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