Hello, aazir.
Not related to the topic, but I have to point that it is "want" not "wont".
From what I guess what you want is not
returning value.
You want to
pass value to invoice function.
============================================
1 2 3 4
|
void Sum( int a, int b )
{
std::cout << a + b;
}
| |
The function above
takes two integer value as
parameter and prints the result. You can use it like this:
1 2 3
|
int whatever = 3;
int something = 5;
Sum(whatever, something);
| |
You are
passing whatever and something to Sum function in this case.
============================================
1 2 3 4
|
int GetOne( void )
{
return 1;
}
| |
The function above takes no parameter and
returns integer value. In this case, the result is 1. You can use it like this:
1 2 3 4
|
int myVar = GetOne();
// result of the code above is same as doing this:
// int myVar = 1;
| |
============================================
Now following function takes two integer and returns one integer value, which is the sum of two integers given:
1 2 3 4
|
int GetSum( int a, int b )
{
return a + b;
}
| |
Hope it helped.