Suppose ptr is some pointer then :
*((int *)ptr+1)
means what:
first type cast ptr to int * then increment by one, then dereference.
OR
first increment ptr by one, then typecast, then dereference.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A cast has a higher precedence that addition, c.f. here. Thus, first convert to integer pointer and then add
1*sizeof(int).