#include <stdio.h>
#include <stdlib.h>

typedef struct Slot
{
	int min;
	int max;
}Slot;

typedef struct Table
{
	Slot* *array;
	int size;
}Table;

Table* createTable( int size )
{
	Table* table = malloc( sizeof( Table ) );

	if( !table )
		return NULL;

	table->array = ( Slot(*)[size] ) malloc( size * size * sizeof( Slot ) );

	if( !(table->array) )
			return NULL;
	
	table->size = size;

	return table;
}

void foo( int arr[], int size )
{
	Table* table = createTable( size );

	if( table == NULL )
	{
		printf( "Out of memory" );
		return;
	}

	int i;

	//for( i = 0; i < size; ++i )
	//	(table->array[i][i]).min = (table->array[i][i]).max = arr[i];
}

int main()
{
	int arr[] = {4,5,1,5,7,6,8,4,1};
	int size;

	size = sizeof( arr ) / sizeof( *arr );

	foo( arr, size );
	
	return 0;	
}