[ create a new paste ] login | about

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

C, pasted on Apr 1:
// 配列の受け渡し
#include <stdio.h>
#define NUMBER 10

void set_idx(int *v, int n)
{
    int i;

    for(i=0; i<n; i++)
        v[i] = i;
}

int main(void)
{
    int i;
    int a[] = {0};

    set_idx(a, NUMBER);

    for(i=0; i<NUMBER; i++)
        printf("a[%d] = %d\n",i, a[i]);

    return 0;
}


Output:
1
Disallowed system call: SYS_socketcall


Create a new paste based on this one


Comments: