|
I've been watching this thread all day. Hopefully, this will make it clear to everyone. Compile this and watch what happens. Ask if you still have questions.
,d #include <stdio.h>
int main()
{
int *x , xval , y;
/* Create some variables */
xval = 5;
x = &xval;
y = 2;
printf("x = %d\n",x);
printf("*x = %d\n",*x);
printf("y = %d\n\n",y);
/* The expression in question */
printf("let *x = y\n");
*x = y;
printf("x = %d\n",x);
printf("*x = %d\n\n",*x);
/* what may _appear_ to be happening in some
interpretations */
printf("Now x = y\n");
x = y;
printf("x = %d\n",x);
printf("x (address %d) cannot be printed\n",x);
return 0; }
|
reference my previous comment by Michael C. Brizic, 2000, Nov 09
to: