#include "header.h" void FindLargest(void) { int x,y,a,b; long int largest; largest=CharVect[0][0]; //at the start, the largest is set to be the first element of the matrix for(x=0;x<256;x++) { for(y=0;y<256;y++) { if(CharVect[x][y]>largest) { largest=CharVect[x][y]; a=x; b=y; } } } CharVect[a][b]=-1; //the largest element is recorded and then has its value changed to -1 so that the next largest can be found printf("{%d,%d} \t%d\n",a,b,largest); }