As im never at need after constant size arrays i can give you something like this:

Code:
#include <acknex.h>

//for new struct allocating
#define new(struktura) sys_malloc(sizeof(struktura))
#define newm(struktura, daudzums) sys_malloc(daudzums*sizeof(struktura))
//no matter which type as any pointer have same size except void* which will nto work here
typedef unsigned int* pointer;

//Array for any pointers you need
typedef struct Array
{
	pointer values;
	int length;
}Array;

//simple array control
Array* Array_inic(int length)
{
	Array* lok_array = new(Array);
	lok_array.values = newm(pointer, length);
	lok_array.length = length;
	return lok_array;
}

Array Array_del(Array* array)
{
	sys_free(array.values);
	sys_free(array);
}

void print_var(Array *input_array, unsigned int index_x, unsigned int index_y)
{
	Array* lok_array = (Array*)(input_array.values)[index_x];
	var* output_var = (lok_array.values)[index_y];
	
	printf("array[%.0f][%.0f] = %.0f", (double)index_x, (double)index_y, (double)*output_var);
}

void main()
{
	randomize();
	
	Array* vars = Array_inic(8);
	
	int i;
	int j;
	
	for(i = 0; i <= 8; i++)
	{
		(vars.values)[i] = Array_inic(8);
		for(j = 0; j <= 8; j++)
		{
			var* lok_var = new(var);
			*lok_var = random(100);
			Array* lok_array = (vars.values)[i];
			(lok_array.values)[j] = lok_var;
		}
	}	
	
	wait(1);
	
	print_var(vars, 4, 4);
}



As this struct is pointer array every value need to be pointer too, but you can define specific things as 2darray struct or even only function for that.

Overall i was amazed about 2d array not working through parameter.

Last edited by Arrovs; 09/11/13 20:44.

Arrovs once will publish game