Here's a suggestion: when you don't understand program output, sprinkle a few printf()s around.
consider:
Code:
#include <stdio.h>
main ()
{
typedef struct {
int *c;
int *d;
}ABC;
ABC tt;
int x=10, y=11;
tt.c = &x;
tt.d = &y;
printf("tt.c = %p\n", tt.c);
printf("*tt.c = %d\n", *tt.c);
printf("tt.d = %p\n", tt.d);
printf("*tt.d = %p\n", *tt.d);
// the following makes tt.c point to who-knows-where
(tt.c)++ ; // lincrementing = 10+1
printf("After incrementing tt.c = %p\n", tt.c);
printf("After incrementing tt.c, *tt.c = %d\n", *tt.c);
// tt.c is a pointer; you are printing the value of the pointer,
// not the value of who-knows-what that tt.c is pointing to
printf ("value of x %u\n", (tt.c)) ;
printf ("value of x %p\n", (tt.c)) ;
return 0;
}
Dave