开发者

error: syntax error before 'double'

void normalizeStepOn开发者_如何学Goe (double F[], double hsum, double V, double Fkjsum)
{
    int i;  
    F[i] = hsum/V;
    Fkjsum+=F[i];
return;

in main I try to call this function in this way:

normalizeStepOne (double F[0], double Csum, double VC, double Fkjsum);

and I got error: syntax error before 'double'

whats wrong here?


You must not include type declarations at the call site. Instead it should read something like this:

double F[ARRAY_LEN];
double Csum;
double VC;
double Fkjsum;
/* initialize the variables */
normalizeStepOne(F, Csum, VC, Fkjsum);


when calling a function there is no need to specify a data type, so your call should be:

normalizeStepOne (F[0], Csum, VC, Fkjsum);

Between first parameter as from the function definition i can see is an array type but you are passing an individual array element i.e. F[0], shouldn't it be F only


When you call a function, you don't give the types. Only the arguments.


You shouldn't include the data type when calling your function.

normalizeStepOne (F, Csum, VC, Fkjsum);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜