for loop and array problem
i use this for loop a lot in the programm
Code:
void op(int n,int m,int ir,int du,int dl,int nm1,double w[9801],double b[9801],double g[9801])
{
double sum;
int T1,l,j,nmr,ndl,ndu;
nmr = n-m+ir;
ndl = n-dl;
ndu = n-du-1;
sum = 0;
..........
for(l=0;l<=nmr-j;l++)
{
T1 = j+m-ir+l;
if(ir-l>0)
{
464 pq(n,dl,i,T1,v,y);
465 sum = sum+e[ir-l-1][j+1-ir+l-1]*am[v-1][y-1];
}
}
Code:
void pq(int n,int dl,int p,int q,int v,int y)
{
if(p >= q)
{
v = n+1-p;
y = p+1-q;
}
else
{
v = n+1-q;
y = dl+q-p;
}
}
and get this errors
C:\Documents and Settings\massimo!\Desktop\test.c(464) : warning C4047: 'function' : 'int ' differs in levels of indirection from 'double [9801]'
C:\Documents and Settings\massimo!\Desktop\test.c(464) : warning C4024: 'pqtest' : different types for formal and actual parameter 5
C:\Documents and Settings\massimo!\Desktop\test.c(464) : warning C4047: 'function' : 'int ' differs in levels of indirection from 'double [9801]'
C:\Documents and Settings\massimo!\Desktop\test.c(464) : warning C4024: 'pqtest' : different types for formal and actual parameter 6
C:\Documents and Settings\massimo!\Desktop\test.c(465) : error C2107: illegal index, indirection not allowed
C:\Documents and Settings\massimo!\Desktop\test.c(465) : error C2107: illegal index, indirection not allowed
C:\Documents and Settings\massimo!\Desktop\test.c(465) : error C2297: '*' : illegal, right operand has type 'double (*)[800]'
i dont understand,if you please have an idea