What will be the output of the following program?
main() { int a[2][2] = { {1,2},{3,4} }; int(*p)[2][2]; p = &a; printf("%d", (*p)[0][0]); }
$a$ is an int array of size $2 \times 2.$
$p$ is a pointer to $\textsf{int}$ array of size $2 \times 2.$
$p = \&a \rightarrow p$ points to array $a.$ Thus, $a$ and $*p$ are now equivalent.
(*p)[0][0] ≣ a[0][0]
Answer:- A
64.3k questions
77.9k answers
244k comments
80.0k users