really messy code..sorry
Code:
int main(int argc, char *argv[])
{
FILE *input;
int N, K, x, pos=4, b, s, r=0, q=0;
int unequal=0, f=6, g, y=0, m, t;
int **array=NULL, *bleh, **new_array=NULL;
int *array;
char *axe, *wax;
int J=0, max = 0;
int max_rows = 0, max_cols = 0, column=0, row=0, new_col;
input = fopen(argv[1], "r+");
fscanf(input, "%d %d", &N, &K);
axe = (char*)malloc(K*sizeof(char));
wax = (char*)malloc(K*sizeof(char));
new_array = malloc(N*sizeof(int*));
bleh = malloc(N*sizeof(int));
for(x=0; x<N; x++){
array[x]=(int*)malloc(N*sizeof(int));
new_array[x]=malloc(N*sizeof(int));
}
do
{
fseek(input, pos, SEEK_SET);
fgets(wax, K+1, input);
for(x=0; x<N-1; x++)
{
fseek(input, pos+1+f, SEEK_SET);
fgets(axe, K+1, input);
f+=K+1;
unequal=0;
for(g=0; g<K; g++)
{
if(wax[g]!=axe[g])
unequal++;
}
bleh[q] = unequal;
q++;
}
pos+=K+1;
f=6; N--; y++;
} while(y<=N+1)
q=0; t=1;
max_rows = b; column = r; max_cols = s;
row = m; new_col = t;
//and then the for loops i already pasted go here