Alternative to the suggestion of @Chris:
You can create 2d array as an array of one-dimensional arrays. This will allow you to do array element indexing as you used to. Be aware that in this case array is allocated in heap, not in stack. Therefore, when you don't need the array anymore, you must clean the allocated memory.
Example:
#include <malloc.h>
#include <string.h>
/* Create dynamic 2-d array of size x*y. */
int** create_array (int x, int y)
{
int i;
int** arr = (int**) malloc(sizeof (int*) * x);
for (i = 0; i < x; i++)
{
arr[i] = (int*) malloc (sizeof (int) * y);
memset (arr[i], 0, sizeof (arr[i]));
}
return arr;
}
/* Deallocate memory. */
void remove_array (int** arr, int x)
{
int i;
for (i = 0; i < x; i++)
free (arr[i]);
free (arr);
}
int main()
{
int x = 5, y = 10;
int i, j;
int** plansza = create_array (x, y); /* Array creation. */
plansza[1][1] = 42; /* Array usage. */
remove_array (plansza, x); /* Array deallocation. */
return 0;
}