You can use something like this:

Code:
int *array;

array[(row * n) + col] = x



While n is the number of elements, row the row and col the column. To make it more convenient, you can use this makro:

Code:
int *array;

#define M(row,col)  array[(row * n) + col]
M(1, 1) = x;



Of course you need to allocate the memory as one dimensional array. Like this:
Code:
int *array = (int *)malloc((rows * cols) * sizeof(int));




Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com