J
JS
I would like to print char 'd':
main(){
char g[4];
g[0] = 'a';
g[1] = 'b';
g[2] = 'c';
g[3] = 'd';
char *pp;
pp = &g[3];
printf("%s", *pp);
getchar();
}
But its only possible to get d printed if I change:
printf("%s", *pp);
into:
printf("%s", pp);
But when I do the same thing with an int I have to use the first version of
the printf:
main(){
int j = 50;
int *q;
q = &j;
printf("%d", *q);
getchar();
}
Why is it the other way around with integers??
JS
main(){
char g[4];
g[0] = 'a';
g[1] = 'b';
g[2] = 'c';
g[3] = 'd';
char *pp;
pp = &g[3];
printf("%s", *pp);
getchar();
}
But its only possible to get d printed if I change:
printf("%s", *pp);
into:
printf("%s", pp);
But when I do the same thing with an int I have to use the first version of
the printf:
main(){
int j = 50;
int *q;
q = &j;
printf("%d", *q);
getchar();
}
Why is it the other way around with integers??
JS