[b]Need help quickly please[/b]
Oct 14, 2014 at 7:22pm UTC
The error is too few arguments to function in refrence to add_values()
How do I fix that?
Also how do you recall for example user_num[2] to edit it or what would the code be for that?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
void display_menu (void );
void add_values (float stored_values [10]);
void edit_value (float stored_values[10], int element_to_change);
void print_value(float stored_values [10]);
void display_stats(float stored_values [10]);
void exit_program(void );
int user_num[9] = {0};
int user_input;
int main()
{
cout << "Hello, please select an option from the list below. 10 numbers are necessary to end this program." << endl;
display_menu();
return 0;
}
void display_menu(void )
{
while ((user_input > -999) || (user_input < 999))
{
char Add;
char Edit;
char Print;
char Display;
char Exit;
cout << "(Add) Add a value" << endl;
cout << "(Edit) Edit a value" << endl;
cout << "(Print) Print a value" << endl;
cout << "(Display) Display Statistics" << endl;
cout << "(Exit) Quit the program" << endl;
if (cin >> Add)
{
add_values();
}
Last edited on Oct 14, 2014 at 8:05pm UTC
Oct 14, 2014 at 7:28pm UTC
Line 3 says that there is a function with name "add_values" that requires exactly 1 argument: an array of floats.
Line 53 calls a function with name "add_values" that does not need any arguments. No such function is known to exist.
Either the function has to be changed to take no arguments, or the function call has to provide appropriate argument.
What do you mean by "recall array"?
Oct 14, 2014 at 7:31pm UTC
So what would I put as the argument for line 53 to get it to call up the function in line 3?
I want to be able to call up a piece of the array so that I may edit it. thats what I mean by recall the array
Topic archived. No new replies allowed.