fuction calling need help in cstdio

having problem understanding the int main() how to connect the functions to gather.

working on a program i need two functions to call to each other.
i want to print out the result on the void help at the bottom not the main ()
can any one help guild a newbie :/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  #include <cstdio>
  #include <cmath> 
int stuff();
void help(int a, int b, int c);

int main()
{
result;
result=stuff();
help(result);
(getting error message to few argument)

return 0;

int stuff()
{
scanf stuff
printf stuff
loops stuff
}
void help(int a, int b, in c)
{
equation stuff goes here adding multiplying and stuff here
printf("*");
}
(getting error message to few argument)

Function void help(int a, int b, int c) expects three integer parameters.

At line 10 you attempt to call the function with just one. help(result);

If you want to return more than one value, consider passing the parameters by reference instead.
See tutorial for explanations:
http://www.cplusplus.com/doc/tutorial/functions/

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
#include <cstdio>
#include <cmath> 

void input(int &a, int &b, int &c);
void output(int a, int b, int c);

int main()
{
    int a = 0;
    int b = 0;
    int c = 0;
    
    input(a, b, c);
    output(a, b, c);
}

// pass parameters by reference so they may be changed
void input(int &a, int &b, int &c)
{
    a = 3;
    b = 7;
    c = 12;
}

// pass parameters by value
void output(int a, int b, int c)
{
    printf("a = %d   b = %d   c = %d\n", a, b, c);  
}

Output:
a = 3   b = 7   c = 12
Topic archived. No new replies allowed.