Computer Science, asked by abdulrahmanaltameme, 9 months ago


What is the output of the code snippet?
typedef struct p *q;
struct p { int x; char y; q ptr; };
int main()
{
struct p p = {1, 2, &p};
printf("%d\n", p.ptr->ptr->x);
return 0;
}

A)
1

B)
22

C)
12

D)
2

E)
21

Answers

Answered by urja79
2

Answer:

*ptr: means the value that is pointing to particular location is incremented by one. *ptr++:means that the value that is pointing to the particular address location is incremented by one.

Similar questions