abc = (int *)&abc + 2;
does the (int*) turn the address of abc+2 into a pointer, if not, can someone explain it.
abc = (int *)&abc + 2;
does the (int*) turn the address of abc+2 into a pointer, if not, can someone explain it.
>does the (int*) turn the address of abc+2 into a pointer
No. The address of abc, &abc, is resolved into a pointer (of whatever type abc is). The cast, (int*), converts that resulting pointer to a pointer to an int. The addition of 2 results in a pointer that is 2 * sizeof(int) bytes from &abc. This is the value that is then assigned to abc, which one might presume to be a pointer to int.
Or, abc is assigned a value which is a pointer to a location 2 integers beyond the location of abc itself.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*