473,224 Members | 1,968 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,224 software developers and data experts.

Too many arguments to function

I am trying to compile a program for school and i get a error message back. "In function ... too many arguments to function. What does this mean?
Oct 10 '06 #1
2 74523
9,065 Expert Mod 8TB
It means you are making a function call and have supplied too many arguments in the place that you call the function. i.e. you have more parameters where you call the function than where it is defined.

For instance this code would generate this error, noting strcpy is defined as

char * strcpy ( char * dest, const char * src );

Expand|Select|Wrap|Line Numbers
  1. char string[100];
  2. strcpy(string, "Hello", "World");
Because strcpy take 2 arguments or parameters but I have supplied 3.
Oct 11 '06 #2
You defined a function with two parameters as following:
int sum (int, int);

but you call this function with three or more arguments as following:

s = sum(100, 200, 300);


s = sum(10, 20, .....);

in this case too many arguments to function error will occure.
Oct 11 '06 #3

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

Similar topics

by: Alex | last post by:
Is there any problem with sending function pointers through in a variable argument list? I have a function like the following: typedef (*ptr2FuncType1)( int ); typedef (*ptr2FuncType2)( double...
by: Matt Eberts | last post by:
Sorry, bad title. Anyway, is there a way to pass the arguments to an object instantiated via a constructor using the arguments object and have it expanded, so to speak, so that it doesn't appear as...
by: A. Saksena | last post by:
Hi all, Is it possible to write a function or a macro in C++, which is capable of accepting any number of arguments. To give an example, the following should be possible: - ...
by: celalo | last post by:
Hi, I need a function that takes not-fixed number of arguments. There is a perfect solution at PHP (func_get_args) but I could not find an alternative for JavaScript. reference:...
by: jhullu | last post by:
hi all i've a function F as function F($arg1,$arg2,$arg3){ .... } and a variable $args = "A,B,C"
by: sfeher | last post by:
Hi All, Is there a way to preserve the arguments across functions? I have: <script> function myFirstFunction() { // arguments = 'param1'
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...
by: runsun pan | last post by:
I wanna check if an object is the *arguments* object of a function, is that possible? When we do: typeof(arguments) it always returns "object", doesn't seem to be helpful.
by: laredotornado | last post by:
Hi, I want to pass my function myFunc('a', 'b', 'c') as an argument to another function. However, this will not work doStuff('x', 'y', myFunc('a', 'b', 'c'))
by: pnbaocuong | last post by:
Dear All When I try to use convert function of MS sql server like this: String sql = " (employee_id = '" + employee_id + "') and ((convert(VARCHAR,w_date,103) = '" + w_date + "'))"; ...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.