706 views

3 Answers

1 votes
1 votes
In the first printf, Address of operator (&) and pointer operator (*) cancel the effect of each other leading to printing the address in ptr which contains the address of a

In the second printf, it is simply printing the address of a

So these two results in same value
1 votes
1 votes
The associativity of * and & in operator precedence table is right to Left, this means when we say “&*ptr” this means we first dereference the pointer ptr to reach “a” and then print the address.

Therefore we get both the print statements equal.

Related questions

3 votes
3 votes
2 answers
1
Shamim Ahmed asked Dec 11, 2018
590 views
char *a = “MADEEASY”;char *b = “GATECSIT2019”;char *r = a;char *s = b;printf(“%d”, (int) strlen (b+3[r] – 1[s]));return 0; Whats the output? Answer given 8
1 votes
1 votes
0 answers
2
sm asked Dec 29, 2017
306 views
1 votes
1 votes
0 answers
3