Adding integer value with Pointer
int *ptr , n; ptr = &n ; ptr = ptr + 3;
Live Example 1 : Increment Integer Pointer
#include<stdio.h> int main(){ int *ptr=(int *)1000; ptr=ptr+3; printf("New Value of ptr : %u",ptr); return 0; }
Output :
New Value of ptr : 1006
Formula :
ptr = ptr + 3 * (sizeof(integer)) = 1000 + 3 * (2) = 1000 + 6 = 1006

