void* ptr1 = NULL;
void* ptr2 = ptr1;
unsigned int *buf = data;//some buffer
//now
ptr2 = buf + 8;
The above change in address of ptr2 is not reflected in ptr1.
I am trying void* ptr2 = &ptr1; too.
Please let me know whats the mistake here.
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.
If you want ptr1 to follow ptr2:
Now *ptr1 follows ptr2