/*--------------------------------------------------------------------*/
/*  Function chapter5_46                                              */
/*                                                                    */
/*  The function called minor computes the minor of a square matrix   */
/*  with n rows and n columns.                                  */

double minor(double a[4][4], int row, int col);

#define NROWS 4
#define NCOLS 4
#define FILENAME "matrix.txt"

int main(void)
{
	/* Declare variables*/
	FILE *matrix;
	int array[NROWS][NCOLS];
	int row, col;

//Open the file
	matrix = fopen(FILENAME, "r");

//Make sure the file opened properly
	if (matrix == NULL)
		printf("Error opening input file\n");
	else
	{
	//Read in the array values
		for (row=0; row<NROWS; row++)
		{
			for(col=0; col<NCOLS; col++)
			{
				fscanf(matrix,"%i",&array[row][col]);
			}
		}

		
	int picked_row = 1, picked_column = 1;
	
		
	//Write out the array values (in a nice form)
		printf("\n");
		for (row=0; row<NROWS; row++)
		{
			for(col=0; col<NCOLS; col++)
			{
				printf("%5i",array[row][col]);
			}
			printf("\n");			
		}
	
	}
	/* Exit Program */
	return 0;
}

double minor(double a[4][4], int row, int col);
{
	/*  Declare and initialize variables.  */
	int i, j, r=0, c=0;
	double m[3][3], det;

	/*  Determine minor matrix.  */
	//Write loop to put matrix into right form (a 3x3 by excluding the correct row and column)
	for (i=0; i<4; i++)
	{
		}
	}

	/*  Now calculated determinant m.  */
	/*  Return determinant.  */
	return det;
}
/*--------------------------------------------------------------------*/
