How do I use variables from other functions in the MAIN function?

I have 3 functions and all of them have information the user inputs, but then I need to grab all that information and compute something in another function.

I heard I have to use return to do this?
But I am really unclear on how this command works, can somebody please give me an example? It would be really helpful.
1
2
3
 int function()
{//...blah blah blah...
return whatever;}


Then you can assign what ever the function returns to a variable in main like this
1
2
3
4
5
6
int main()
{ int fun;

fun = function();

//...} 
Ok thanks a lot.
Topic archived. No new replies allowed.