473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

how to solve too many arguments in function call ?

Here is my program.If got any error ,can you fix it?Thank you.
Attached Files
File Type: txt program.txt (2.8 KB, 977 views)
Aug 24 '14 #1
4 21289
Luuk
1,047 Expert 1GB
Compiling your code gives next error:
Expand|Select|Wrap|Line Numbers
  1. program.cpp: In function ‘int main()’:
  2. program.cpp:77:32: error: too many arguments to function ‘void list()’
  3. program.cpp:18:6: note: declared here
  4. make: *** [program] Error 1
  5.  
The error seems to be at line 77:
Expand|Select|Wrap|Line Numbers
  1.             case 1: list(products, index);
  2.  
related, line 18:
Expand|Select|Wrap|Line Numbers
  1. void list();
  2.  
Aug 24 '14 #2
How to fix it?I really don't know how to fix it
Aug 24 '14 #3
weaknessforcats
9,208 Expert Mod 8TB
You have:

Expand|Select|Wrap|Line Numbers
  1. void list();
  2.  
and then you have:

Expand|Select|Wrap|Line Numbers
  1.  list(products, index);
  2.  
Now either the list functions has no arguments or it has two arguments. If I has no arguments, then you can't use arguments. If it has two arguments, then you can't advertise it as having no arguments.
Aug 24 '14 #4
problem fixed.Thank you.
Aug 25 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Chuck Anderson | last post by:
I have a function with 7 inputs. The last three have default values. I want to call that function specifying the first four, skip two and then specify the last. I thought I could write this...
2
by: bwooster47 | last post by:
I'm a newcomer to python - what is the best way to convert a list into a function call agruments? For example: list = (2005, 5, 5) date = datetime.date( list ) fails with: TypeError:...
9
by: Martin Waller | last post by:
Hello, I've been playing with the idea of just how to use an ASP page to provide a remote function call. In an ideal world this would be a web service but how can you do it if restricted to ASP...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
10
by: Felix Kater | last post by:
Hi, is it possible to define a function in a way that when calling it I can insert as many arguments as I want? (I would neither like to define a function with 50 default arguments nor prepare a...
11
by: Neo | last post by:
Why the following code is compilable? The function abc() doesn't take any arguments, still i can call the function with arbitraty number of arguments. Even compiler doesn't show any warning. What...
9
by: ashok.anbalan | last post by:
Hi, Can someone tell me if the language imposes any restrictions on the maximum number of arguments that can be passed via a function call? Thanks, Ashok
16
by: Martin Jørgensen | last post by:
Hi, Problem: ======== Some of my output functions are beginning to take pretty many arguments... I mean.... We're talking about 10-15 arguments :-) So I thought to myself, perhaps this is...
4
by: golubovsky | last post by:
Hi, Is there an easy way to construct a function call out of a function and an array of actual arguments? e. g. given a function `fun' and an array I need to obtain equivalent of...
7
by: lordkain | last post by:
Hello all, I have a problem which I cant seem to solve, I dont know if it is solvable.. it should though. What I want is to call a function, whith x arguments on base of an xml file. In the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.