Hi,
you use %n in scanf for getting the integer equal to the number of characters read so far
eg:
int n = 0;
char str[100]={0};
scanf("%s %n",&str,&n);
if you now input the following to this program
abc<enter>
a<enter>
then
str = "abc"
and n=4, indicating that till now 4 characters has been entered i,e a b c and a.
you use %p to read the pointer value from the input
eg:
int *c=0;
scanf("%p",&c);
if you input the following to this program
1) abc, then the value of c will be 0x00000abc ,
2) absss, then the value of c will be 0x000000ab, note that it ignored sss coz they are not valid hex codes.
hope that clears up for you.