Int main()
{
Int a = 42;
int b = 7;
int c = 999;
int *t = &a;
int *u = NULL;
printf("%d %d\n", a, *t);
c = b;
u = t;
printf("%d %d\n", c, *u);
a = 8;
b = 8;
printf("%d %d %d %d\n", b, c, *t, *u);
*t = 123;
printf("%d %d %d %d %d\n", a, b, c, *t, *u);
}
Rewrite the previous code into your c compiler:
1. Update t to point to c. Use a pointer dereference to change the value of c to 555.
Verify that it worked by adding a printout. Does this change any of the other values?
2. Change the value of c again using a direct assignment. Verify that the pointer t still
points to the value by printing the result of dereferencing it
3. Would happen if you tried to execute the following code? How could you fix it?
int *v = &t;
printf("%d\n", *v);