[ create a new paste ] login | about

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

appunti2 - C, pasted on May 2:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>

int main (void)
{
  int a[] = {1, 2, 3, 4};
  int b[] = {5, 6,};
  int c[] = {7, 8, 9};
  int *x[] = {a, b, c};
  int **y = x;

  printf ("*x[0] = {%i, %i, %i, %i}\n", y[0][0], y[0][1],
                                        y[0][2], y[0][3]);
  printf ("*x[1] = {%i, %i}\n", y[1][0], y[1][1]);
  printf ("*x[2] = {%i, %i, %i}\n", y[2][0], y[2][1],
                                    y[2][2]);

  getchar ();
  return 0;
}


Output:
1
2
3
*x[0] = {1, 2, 3, 4}
*x[1] = {5, 6}
*x[2] = {7, 8, 9}


Create a new paste based on this one


Comments: