I really do not understand why i keep on getting this error "Array type 'double [10][10] is not assignable' " I tried passing an array inside and it still doesn't seem to work
Aren't I allow do this. What is an alternative ? Thanks for your help
#define MAX 10
//structures usually defined at top along with function prototypes
typedef struct {
unsigned int row;
unsigned int col;
double array [MAX][MAX];
}Matrice;
Matrice lire_matrice(void);
Matrice multiplication( Matrice a, Matrice b);
void affiche_matrice(Matrice m);
int main(int argc, const char * argv[]) {
//insert code here...
Matrice m1 = lire_matrice();
Matrice m2 = lire_matrice();
}
Matrice lire_matrice(void){
unsigned int row,col;
printf("Enter row which must be smaller or equal to %d ", MAX);
scanf("%d",&row);
printf ("Enter col which must be smaller or equal to %d",MAX);
scanf("%d",&col);
double table[row][col];
int i;
int j;
double input;
for(i = 0; i < row; i++){
for(j= 0; i < col;j++){
printf("M[%d,%d] =",i,j);
scanf("%lf",&input);
table[i][j]= input;
}
}
Matrice m;
m.array = table; <<**ERROR ARRAY TYPE DOUBLE[10][10] IS NOT ASSIGNABLE**>>
m.row = row;
m.col = col;
return m;
}