[ create a new paste ] login | about

Link: http://codepad.org/6BXKTQeS    [ raw code | output | fork ]

appunti2 - C, pasted on May 2:
#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);

  getchar ();
  return 0;
}


Output:
1
2
3
4
i, p, pp, ppp: 123, 3212690092, 3212690088, 3212690084
i, p, pp, *ppp: 123, 3212690092, 3212690088, 3212690088
i, p, *pp, **ppp: 123, 3212690092, 3212690092, 3212690092
i, *p, **pp, ***ppp: 123, 123, 123, 123


Create a new paste based on this one


Comments: