'error: invalid operands to binary *' problem
I've declared a matrix array but I've had some problems trying to solve this
Code:
float dot_product(double *, double *, size_t);
float
dot_product(double * weights[6][16], double * X[16], size_t n)
{
float Net[6]={0,0,0,0,0,0};
size_t i;
for (i = 1; i < 16; i++) {
Net[1] += weights[1][i] * X[i];
Net[2] += weights[2][i] * X[i];
Net[3] += weights[3][i] * X[i];
Net[4] += weights[4][i] * X[i];
Net[5] += weights[5][i] * X[i];
Net[6] += weights[6][i] * X[i];
}
return Net[6];
}
It produces the following errors
Code:
Line 42: error: conflicting types for 'dot_product'Line 38: error: previous declaration of 'dot_product' was hereIn function 'dot_product':Line 47: error: invalid operands to binary *Line 48: error: invalid operands to binary *Line 49: error: invalid operands to binary *Line 50: error: invalid operands to binary *Line 51: error: invalid operands to binary *Line 52: error: invalid operands to binary
Any help?