when I was testing double pointer behaviour I got a result that I don't understand well.
==> code 1 :
int main (int argc , char **argv)
{
if(*argv+1 ==NULL)
{
printf("NULL pointer \n");
exit(0) ;
}
else
{
printf("test double pointer[] : %s \n ",*argv+1);
}
return(0);
}
====> result 1
root@root:/home/aa/test# ./geip 1255
test double pointer[] : /geip
root@root:/home/aa/test#
===> code 2 :
int main (int argc , char **argv)
{
if(*argv+9 ==NULL)
{
printf("NULL pointer \n");
exit(0) ;
}
else
{
printf("test double pointer[] : %s \n ",*argv+9);
}
return(0);
}
==> result 2 :
root@root:/home/aa/test# ./geip 1255
test double pointer[] : 55
root@root:/home/aa/test#
==> result 3 :
root@root:/home/aa/test# ./geip
test double pointer[] : ELL=/bin/bash
root@root:/home/aa/test#
it seems that printf display from n th word (1 and 9) how we can explain this behaviour of pointer ?