Dear Users,
Please consider the following codes:
/* p1.c */
...
1-int x=16, *p;
2-
3-p=&x;
5-printf(%p\n, *&p);
...
/* p2.c */
...
1-int x=16, *p;
2-
3-p=&x;
5-printf(%d\n, &*p);
...
/* p3.c */
...
1-int x=16, *p;
2-
3-p=&x;
4-printf(%p\n, *&x);
...
/* p4.c */
...
1-int x=16, *p;
2-
3-p=&x;
4-printf(%d\n, &*x);
...
Theese pieces of code were presented to show the relashionship between:
-&x/p and x/*p
-hexadecimal conversion from one value to another (%p and %d)
- &* and *& cancel themselves
--->But p4.c isn´t working. The compiler is presenting the following error
message:
"Invalid type argument of ´unary´"
Regards
Andre
|