ExamVeda
Login
Home
This question belongs to C Program Pointer
Pointer
?

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

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.