I am making a program in which I multiply matrices, but my big problem is converting from input to two arrays, which I will ultimately multiply. Below is my conversion code, including declaring arrays. (I removed the check that the input is 8 valid floats as I debugged it).
//declare the arrays float a[2][2]; float b[2][2]; float c[2][2]; int main (int argc, char *argv[]) { int i,j,k,l; i=0; l=4; // declare and initialize arrays for( j =0; j<2; j++) { for(k=0;k<2; k++) { a[j][k]=atof[argv[i]]; b[j][k]=atof[argv[l]]; i++; l++; } } ......
I get an error when using atof when compiling, which says: "the indexed value is neither an array nor a pointer" I was looking for an error, but did not understand what this means in my case.
source share