[ create a new paste ] login | about

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

C, pasted on Nov 15:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void init_array(char ary[][10]) {
    int i, j;
    for (i = 0; i < 5; i++) {
        for (j = 0; j < 10; j++) {
                ary[i][j] = '0';
        }
    }
}

int main(void)
{
    char newarray[5][10];
    init_array(newarray);
    printf("%c", newarray[1][1]); /* Testing the output */
    return 0;
}


Output:
1
0


Create a new paste based on this one


Comments: