/***************************************************************************** function for allocating a 2d array ****************************************************************************** Input: d1 first dimension d2 second dimension size size of each array element Output: pointer to the array *****************************************************************************/ void **alloc2d( int d1, int d2, int size) { int i,j; void **p; p = (void**)malloc(d1*sizeof(void*)); if ( p == NULL ) return NULL; for ( i=0; i