#include <stdio.h>
int
main (void)
{
int i = 123;
int *p = &i; // Puntatore al tipo "int".
int **pp = &p; // Puntatore di puntatore al tipo
// "int".
int ***ppp = &pp; // Puntatore di puntatore di puntatore
// al tipo "int".
printf ("i, p, pp, ppp: %i, %u, %u, %u\n", i, (unsigned int) p, (unsigned int) pp,
(unsigned int) ppp);
printf ("i, p, pp, *ppp: %i, %u, %u, %u\n", i, (unsigned int) p, (unsigned int) pp,
(unsigned int) *ppp);
printf ("i, p, *pp, **ppp: %i, %u, %u, %u\n", i, (unsigned int) p, (unsigned int) *pp,
(unsigned int) **ppp);
printf ("i, *p, **pp, ***ppp: %i, %i, %i, %i\n", i, *p, **pp, ***ppp);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludAptYWluICh2b2lkKQp7CiAgaW50IGkgPSAxMjM7CiAgaW50ICpwID0gJmk7ICAgICAgIC8vIFB1bnRhdG9yZSBhbCB0aXBvICJpbnQiLgogIGludCAqKnBwID0gJnA7ICAgICAvLyBQdW50YXRvcmUgZGkgcHVudGF0b3JlIGFsIHRpcG8KICAgICAgICAgICAgICAgICAgICAgLy8gImludCIuCiAgaW50ICoqKnBwcCA9ICZwcDsgIC8vIFB1bnRhdG9yZSBkaSBwdW50YXRvcmUgZGkgcHVudGF0b3JlCiAgICAgICAgICAgICAgICAgICAgIC8vIGFsIHRpcG8gImludCIuCgogIHByaW50ZiAoImksIHAsIHBwLCBwcHA6ICVpLCAldSwgJXUsICV1XG4iLAogICAgICAgICAgaSwgKHVuc2lnbmVkIGludCkgcCwgKHVuc2lnbmVkIGludCkgcHAsCiAgICAgICAgICAodW5zaWduZWQgaW50KSBwcHApOwoKICBwcmludGYgKCJpLCBwLCBwcCwgKnBwcDogJWksICV1LCAldSwgJXVcbiIsCiAgICAgICAgICBpLCAodW5zaWduZWQgaW50KSBwLCAodW5zaWduZWQgaW50KSBwcCwKICAgICAgICAgICh1bnNpZ25lZCBpbnQpICpwcHApOwoKICBwcmludGYgKCJpLCBwLCAqcHAsICoqcHBwOiAlaSwgJXUsICV1LCAldVxuIiwKICAgICAgICAgIGksICh1bnNpZ25lZCBpbnQpIHAsICh1bnNpZ25lZCBpbnQpICpwcCwKICAgICAgICAgICh1bnNpZ25lZCBpbnQpICoqcHBwKTsKCiAgcHJpbnRmICgiaSwgKnAsICoqcHAsICoqKnBwcDogJWksICVpLCAlaSwgJWlcbiIsCiAgICAgICAgICAgaSwgKnAsICoqcHAsICoqKnBwcCk7CgogIHJldHVybiAwOwp9Cg==
i, p, pp, ppp: 123, 3218046628, 3218046624, 3218046620
i, p, pp, *ppp: 123, 3218046628, 3218046624, 3218046624
i, p, *pp, **ppp: 123, 3218046628, 3218046628, 3218046628
i, *p, **pp, ***ppp: 123, 123, 123, 123