#include <stdio.h>
int main()
{
char *pc = "abcdefg";
char **ppc = &pc;
printf("2). *pc : %c\n", *pc
); printf("3). &pc : %08X\n", &pc
); printf("4). ppc : %08X\n", ppc
); printf("5). *ppc : %s\n", *ppc
); printf("6). **ppc : %c\n", **ppc
);
printf("sizeof *pc : %d\n", sizeof *pc
); // sizeof (char) と同義 printf("&(*pc) : %08X\n", &(*pc
)); printf("pc : %08X\n", pc
); // pcの値は"abcdefg"の先頭アドレス printf("*(pc+1) : %c\n", *(pc
+1));
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpCnsKCWNoYXIgKnBjID0gImFiY2RlZmciOwoJY2hhciAqKnBwYyA9ICZwYzsKCglwcmludGYoIjEpLiBwYyA6ICVzXG4iLCBwYyk7CglwcmludGYoIjIpLiAqcGMgOiAlY1xuIiwgKnBjKTsKCXByaW50ZigiMykuICZwYyA6ICUwOFhcbiIsICZwYyk7CglwcmludGYoIjQpLiBwcGMgOiAlMDhYXG4iLCBwcGMpOwoJcHJpbnRmKCI1KS4gKnBwYyA6ICVzXG4iLCAqcHBjKTsKCXByaW50ZigiNikuICoqcHBjIDogJWNcbiIsICoqcHBjKTsKCglwcmludGYoInNpemVvZiAqcGMgOiAlZFxuIiwgc2l6ZW9mICpwYyk7IC8vIHNpemVvZiAoY2hhcikg44Go5ZCM576pCglwcmludGYoIiYoKnBjKSA6ICUwOFhcbiIsICYoKnBjKSk7CglwcmludGYoInBjIDogJTA4WFxuIiwgcGMpOyAvLyBwY+OBruWApOOBryJhYmNkZWZnIuOBruWFiOmgreOCouODieODrOOCuQoJcHJpbnRmKCIqKHBjKzEpIDogJWNcbiIsICoocGMrMSkpOwoKCXJldHVybiAwOwp9Cg==