Actually you have to print the address , is it .If you want the print the address of the variables you have to use '&' since you are trying to get the variables address.If you give the pointer there there there is no need for '&'.
Code:
#include <stdio.h>
main()
{
int i;
char a[]="abc";
printf("%p %p\n",&a[1],&i); // use &
i=a[1];
printf("%c\n",a[1]);
printf("%c\n",i);
printf("%d\n",i);
printf("%p %p\n",&a[1],&i); //use &
}
Result is,
Code:
0xbfd70d9d 0xbfd70da0
b
b
98
0xbfd70d9d 0xbfd70da0
The following is the correct way with out '&'.
Code:
int *p;
printf("%p",p); // No need for & since it is a pointer