An example of how to initialize a matrix: loop
#define X_SIZE 60 #define Y_SIZE 30 int main() { int matrix[X_SIZE][Y_SIZE]; int x,y; /* current element to zero */ for (x = 0; x < X_SIZE; ++x) { for (y = 0; y < Y_SIZE; ++y) { matrix[x][y] = -1; } } return (0); }