| | |
How do I call this function?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2007
Posts: 28
Reputation:
Solved Threads: 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,
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,
•
•
Join Date: Jan 2008
Posts: 97
Reputation:
Solved Threads: 6
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:
Since this is C++, you could prototype your function as
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.
Call as:
Runthrough(&a1,&b1,&time,&amount);Since this is C++, you could prototype your function as
C++ Syntax (Toggle Plain Text)
void Runthrough(double &from, double &to, double &when, double &howmuch) { ... }
In either case, one line or the other must have &'s.
Please use [code] tags.
Hope this helps.
![]() |
Similar Threads
- Warning: Unknown(): Unable to call () - function does not exist in Unknown on line 0 (PHP)
- Call a function at RUNTIME (C++)
- how to call a function in href? (ASP.NET)
- Call Function (ASP.NET)
- how to call this function...using menu..! (C++)
- Using a for loop to sum an integer n and call function add_it (C)
Other Threads in the C++ Forum
- Previous Thread: C++ homework help
- Next Thread: A lovely mixture of random numbers and arrays
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete deploy desktop directshow dll download dynamic encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node number output parameter pointer problem program programming project proxy python read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






