So I have this char array taken from a .txt file (a matrix exactly) and I'm trying to covert it to a floating point two-dimensional array.
char c[MAX]="";
int x=0;
float **mat;
scanf ("%s", name);
FILE* f=fopen(name, "r+");
for (int p=0; !feof(f); p++){
c[p] = fgetc(f);
if (isdigit(c[p])) x++;
}
for (int z=0; z<2*x; z++){
for (int i=0; i<x/2; i++){
for (int j=0; j<x/2; j++){
if (isdigit(c[z]))
c[z]=(float)atof(mat[i][j]);
}
}
}
All I get is that the .exe file is not responding. I know it's because I'm not doing it right