Pointer

#include <stdio.h>
#include <stdlib.h>

int main () {

int a;

printf("%p\n",a);
printf("%p",&a);


system("pause");
return 0;
}



when I run this programme , output shows 2 different addreses of a. What is their differance ? Thank you.
In the first one you are passing the actual integer value (%p only applies formatting to the value you pass in). the second one you are passing the address which, by the sound of it is what you want..
Topic archived. No new replies allowed.