Simple Pointer Trace
Simple Pointer Trace

#include <stdio.h> main() { int a, b, c; int *ptr1, *ptr2; /* Initialization of Variables */ a = 2; b = 4; c = 8; ptr1 = &a; ptr2= &c; printf("a = %d, b = %d, c= %d\n", a, b, c); c = *ptr2 + 7; *ptr1 = b; printf("a = %d, b = %d, c= %d\n", a, b, c); ptr1 = ptr2; *ptr1 *= 4; printf("a = %d, b = %d, c= %d\n", a, b, c); ptr2 = &b; *ptr2 = *ptr1 + 3; a = *ptr2 / a; printf("a = %d, b = %d, c= %d\n", a, b, c); }

Also avaible... The commented version on what all the pointer stuff means. Try to figure it out on your own first. *smile* It's worth it.

Output:

a = 2, b = 4, c= 8 a = 4, b = 4, c= 15 a = 4, b = 4, c= 60 a = 15, b = 63, c= 60


Main Page