Curso de Programación en C/Prog74
Ir a la navegación
Ir a la búsqueda
Prog74
1 #include <stdio.h>
2
3 int main(void)
4 {
5 int zippo[4][2] = { {2,4}, {6,8}, {1,3}, {5, 7} };
6
7 printf(" zippo = %p, zippo + 1 = %p\n",
8 zippo, zippo + 1);
9 printf("zippo[0] = %p, zippo[0] + 1 = %p\n",
10 zippo[0], zippo[0] + 1);
11 printf(" *zippo = %p, *zippo + 1 = %p\n",
12 *zippo, *zippo + 1);
13 printf("zippo[0][0] = %d\n", zippo[0][0]);
14 printf(" *zippo[0] = %d\n", *zippo[0]);
15 printf(" **zippo = %d\n", **zippo);
16 printf(" zippo[2][1] = %d\n", zippo[2][1]);
17 printf("*(*(zippo+2) + 1) = %d\n", *(*(zippo+2) + 1));
18
19 return 0;
20 }
Resultado
[rrc@Pridd CClase]$ gcc -Wall -o Prog74 Prog74.c [rrc@Pridd CClase]$ ./Prog74 zippo = 0xbfbcfcc0, zippo + 1 = 0xbfbcfcc8 zippo[0] = 0xbfbcfcc0, zippo[0] + 1 = 0xbfbcfcc4 *zippo = 0xbfbcfcc0, *zippo + 1 = 0xbfbcfcc4 zippo[0][0] = 2 *zippo[0] = 2 **zippo = 2 zippo[2][1] = 3 *(*(zippo+2) + 1) = 3 [rrc@Pridd CClase]$