When a function is finished, the final statement in the funct can be something like return x; x is the value returned into the variable.
Example:
val = add(a, b); // add A and B
...
int add (int x, int y) // define the add function
{
int z;
z = x + y; // add the values
return z; // return the value of the addition
}
val will contain the sum when the function is finished.
When you get to functions you will understand -- I hope ;)
WaltP
Posting Sage w/ dash of thyme
10,492 posts since May 2006
Reputation Points: 3,348
Solved Threads: 943