I have a simple program here:
Code:
void main()
{
        int *p;
        p = (int *)&p + 2;                              /* what???? */
        (*p) = (int)somewhere_else;
}
I found that code on the net, and I'm wondering what that second instruction means. The program is supposed to change the function's return address. I would do the same thing like this:
Code:
void main()
{
        int *p;
        p = p + 2;
        (*p) = (int)somewhere_else;
}
Could somebody just explain what that earlier example's 2nd instruction means. There's like &-operator in front of a pointer??? somewhere_else is just a pointer pointing somewhere else.