0

The function is as follows:

void Runthrough(double * from, double * to, double * when, double * howmuch)
{
nflows += 1;


if (nflows > LENFST)
{   /* Stack Overflow */
Application->MessageBox("Error occurred.", MB_OK);
return;
}
else
{       /* Store the arguments in the stack */
flowstack[nflows].from = from;
flowstack[nflows].to = to;
flowstack[nflows].when = *when;
flowstack[nflows].amt = *howmuch;
}


return;
}

when I call in the main program: Runthrough(a1,b1,time,amount), a1,b1,time,amount all defined as double, I got error message:

incompatible conversion, type mismatch, and cannot convert "long[*][long]" to "double". I don't use array here.

Can any one help to find the problem?

Thx,

Edited by happygeek: fixed formatting

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Duoas
0

The problem is that a1, b1, time, and amount are all defined as double, and your routine wants a pointer to double.

Call as:

Runthrough(&a1,&b1,&time,&amount);

Since this is C++, you could prototype your function as

void Runthrough(double &from, double &to, double &when, double &howmuch)
{
   ...
}

then you could call the function the way you were.

In either case, one line or the other must have &'s.

Please use code tags.

Hope this helps.

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.