[ create a new paste ] login | about

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

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

void print_array(int size, int *a) {
  int i;
  for(i = 0; i < size; i++) {
    a[i] = i;
  }
}

#define N 3
int main () {
  int b[N];
  print_array(N, b);
  printf("%d\n",b[0]);
  printf("%d\n",b[1]);
  printf("%d\n",b[2]);
  return 0;
}
/* end */


Output:
1
2
3
0
1
2


Create a new paste based on this one


Comments: