summaryrefslogtreecommitdiff
path: root/reference/C/CONTRIB/OR_PRACTICAL_C/14_16.c
blob: 5b040e40b8553a801fe7c6da8660bedd6b516c21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#define X_SIZE 60
#define Y_SIZE 30

int matrix[X_SIZE][Y_SIZE];

void init_matrix(void)
{
    register int index;         /* element counter */
    register int *matrix_ptr;

    matrix_ptr = &matrix[0][0];
    for (index = 0; index < X_SIZE * Y_SIZE; index++) {
        *matrix_ptr = -1;
        matrix_ptr++;
    }
}