ExamVeda
Login
Home
This question belongs to C Program Structure And Union
Structure and Union
?

What will be the output of the following C code?
#include <stdio.h>
struct p
{
    int x;
    char y;
};
void foo(struct p* );
int main()
{
    typedef struct p* q;
    struct p p1[] = {1, 92, 3, 94, 5, 96};
    foo(p1);
}
void foo(struct p* p1)
{
    q ptr1 = p1;
    printf("%d\n", ptr1->x);
}

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.