#include
int main(void)
{
int x = 99;
int *pt1;
pt1 = &x;
printf(\"Value at p1: %d\\n\", *pt1);
printf(\"Address of p1 (with %%
If on your system pointers happen not to be the same size as int
s, you can cause an unlimited amount of screwage. If they happen to be the same size, then you're probably safe. As far as the language standards go, though, passing a pointer and treating it as an integer is allowed to set fire to your computer, send pornographic email to your boss, or cause demons to fly out of your nose. It probably won't do any of those things, but it could conceivably print out misleading values or something.
Don't do this. Use %p
unless you have a desperate need to treat the address as an integer (note: you probably don't); in that case, actually cast it to an integer type so that you aren't abusing the argument-passing mechanism.