Got ya, because void cannot return a value, return can only be used to cease the execution of any further pieces of code if something is met.
However, this is what I have now:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
int fun1(int x)
int fun2(int& y)
cout << fun1(x) << endl;
cout << fun2(x) << endl;
With two errors:
1 2 3 4 5
[****@storm homework]$ g++ prob4.cpp
prob4.cpp: In function ‘int fun1(int)’:
prob4.cpp:6:7: error: expected primary-expression before ‘int’
prob4.cpp:6:12: error: ‘fun2’ was not declared in this scope
On line 6, you're re-declaring that x is an int - don't do that.
Also, fun2 doesn't even exist at line 6 yet - you need to either move its definition or forward-declare that it exists.
Lastly, fun1 needs to return a value (because it says it does)
Oh, and probably you want to print the value of x between and after calling each function.