求助!!!哪位高手帮我看看二维数组中应该怎么填
float CHrslMethod::fnt(float x[20],float *f,float g[60],short *w,float sparam[9]) {
float t0=15,tt,dlt,d=0.5,sum,tmlv;
int num,num1,num2,i,j,t,k;
dlt=sparam[4];
sum=0.0;
int row = 7;
tt = t0;
for(k = 0; k < row; k++)
{
while(tt <= t0+WNLN)
{
num = int(tt/tmlv);
num1 = int((tt-x[1]*d)/dlt);
num2 = int((tt+x[1]*d)/dlt);
??? sum += pow(w[k][num]-w[k+1][num1],2) + pow(w[k+1][num]-w[k][num2],2);
tt = tt+dlt;
}
}
*f=sum;
g[1]=x[1]-10.0;
g[2]=700-x[1];
}
这样带到程序里运行完是在?的地方出现subscript requires array or pointer type 这该怎么改呢?
谢谢了!
[ 本帖最后由 aikeyiyao 于 2012-5-24 08:56 编辑 ]