andrey
andrey

Reputation: 681

error: syntax error before 'double'

void normalizeStepOne (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?

Upvotes: 1

Views: 884

Answers (4)

dmc
dmc

Reputation: 2684

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

normalizeStepOne (F, Csum, VC, Fkjsum);

Upvotes: 2

George Kastrinis
George Kastrinis

Reputation: 5182

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

Upvotes: 3

David Heffernan
David Heffernan

Reputation: 613592

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);

Upvotes: 4

Waqas
Waqas

Reputation: 6812

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

Upvotes: 3

Related Questions