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,

Recommended Answers

All 2 Replies

Could you include your whole code? It could be something in main.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.