[ create a new paste ] login | about

Link: http://codepad.org/0hJZbbZ5    [ 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
#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};

  printf ("*x[0] = {%i, %i, %i, %i}\n",
          *x[0], *(x[0]+1), *(x[0]+2), *(x[0]+3));
  printf ("*x[1] = {%i, %i}\n", *x[1], *(x[1]+1));
  printf ("*x[2] = {%i, %i, %i}\n",
           *x[2], *(x[2]+1), *(x[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: