Problem with passing variable to function in C?
-
Hi all!! Have a little problem with a program im trying to get up and running i wont bore you all with the overview ill get to the heart of the matter. i have function call in my main program like this: dup (numin,lottopick,choice); and the function itself is void dup(int numin[],int lottopick,int choice) the problem (as he so adequately put it) is choice (sorry couldnt help it ;S ) the first array variables numin and lottopick work fine but as soon as i try to pass the value "choice" is shows too few arguenets to function 'dup' when i compile. Please help as im soooo close to the end of this program thanks in advance Drew
-
Answer:
Too FEW arguments? I would have expected too MANY arguments. Without seeing the code, I suggest you make sure the function declaration for dup(), if any, matches the actual definition. If you don't have a definition, then the C compiler may be taking your first call instance as the (note: THE) declaration and dislikes any subsequent calls with different calling sequences. (This is a strong reason to use header files with overloaded calling sequences.) Hope that helps.
Franky Fish at Yahoo! Answers Visit the source
Other answers
I don't see the problem right away. Numin must be an array (passed by reference), and lottopick and choice are integers passed by value. Do all the data types match up?
Related Q & A:
- How To Calculate Approximate Expectation Of Function Of A Binomial Random Variable?Best solution by Mathematics
- How to create variable from value in variable?Best solution by Stack Overflow
- How to implement C callback function in Swift?Best solution by pr8x.com
- How to learn C# (moving from C++ to C#?Best solution by stackoverflow.com
- What is the problem with pointers in c?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.