What's the advantage of using a Return function than a void funtion?

I'm a beginner and I've never used a return function before and have always used void instead, can anyone explain to me a circumstance where return function is better than void function?

Bonus question: What does 'return' do? I see it all the time at the end of a return function.
math :)

if you think of functions in math,
y = f(x) type... then the answer becomes obvious.

but basically, you want to compute and return a value.

int addints(int a, int b)
{
return a+b;
}

...
z = add (x,y);
etc... does this make any sense?

its really nice for operator overloading...
Last edited on
Topic archived. No new replies allowed.