C – Pointer Increment

Pointer increment / decrement: When we modify the pointer, the value increase or decrease by size bytes.

int main()
            char x = ‘a’;
            float y = 2.3;
            double z = 4.5;
            char* p1 = &x;
            float* p2 = &y;
            double* p3 = &z;
            printf(“p1 value is : %u \n”, p1);
            printf(“++p1 value is : %u \n”, ++p1);
            printf(“p2 value is : %u \n”, p2);
            printf(“++p2 value is : %u \n”, ++p2);
            printf(“p3 value is : %u \n”, p3);
            printf(“++p3 value is : %u \n”, ++p3);
            return 0;

Scroll to Top