search
Log In
1 vote
211 views
int arr[]={1,2,3,4,5};

int *p2=(int*)(&arr+1);

what is the meaning of p2 ????? please explain
in Programming 211 views
0
P2 is a pointer pointing to array value 2 (integer)
0
i am not understand please explain in detail ,

printf("%d",*(p2-1));

what is the output,according to above question.
3

It will print 5. (last element of the array)

&arr+1 =  &arr+ (5*size of int)

*(p2-1) = p2[-1]

See this: https://gateoverflow.in/232228/array-and-pointer

0
Yes..👍
I was wrong. :(

1 Answer

–1 vote
P2 is an integer pointer and the address of 2nd slot of the array is assigned to p2.

Related questions

0 votes
0 answers
1
51 views
Hello guys !! Is solving previous 10 years gate qs suffice ?? Or should I practise more past year qs ?? Please help me out
asked Apr 2, 2019 in GATE Application Ritabrata Dey 51 views
0 votes
0 answers
2
102 views
i understand that distance vector routing is adaptive but what about link state routing is it adaptive??
asked Nov 26, 2018 in Computer Networks CHïntän ÞäTël 102 views
0 votes
0 answers
3
103 views
How we find the given calculus is safe or not
asked Sep 8, 2018 in Databases bhavnakumrawat5 103 views
3 votes
1 answer
4
216 views
The number of min heap trees are possible with 13 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ___
asked Nov 6, 2016 in Programming Rohan Mundhey 216 views
...