First I would want to know why,if I declare the following:
and then print:Code:char a[]="abcd";
it;s ok and evenCode:printf("%s\n",a);
is goodCode:printf("%c\n",a[1]);
But when I replace the %c into %s so I get:
that's an errorCode:printf("%s\n",a[1]);
I mean , why can;t it print bcd?
is it some logic point I missed or simply syntax?
Another question:
I have teh following declarations:
Code:char *c[]={"door","me","pointers","balul"}; char **cp[]={c+3,c+2,c+1,c}; char ***cpp=cp;
And the following printing lines:
Well I understand the 1st and 2ed lines, it;s the 3rd and 4th I dun quite get...Code:printf("%s\n",**++cpp); printf("%s\n",++**cpp); printf("%s\n",*cpp[-2]+3); printf("%d\n",***cpp); printf("%d\n",**cp);
Why the 3rd line gives trash
And the 4rth gives "inters"?



LinkBack URL
About LinkBacks


