Making an array whose elements are defined by a struct
1D array:

check_t *enqueued = malloc(N * sizeof(*enqueued));
enqueued[0].x = 5;
enqueued[N - 1].x = 2;


2D array:

check_t **enqueued = malloc(N * sizeof(*enqueued));
for(int i = 0; i &lt; N; i++)
    enqueued[i] = malloc(M * sizeof(**enqueued));
enqueued[0][0].x = 5;
enqueued[N - 1][M - 1].x = 2;