+ 1
What means return?
what is return doing in this function int func(int a, int b){ return a + b; }
3 ответов
+ 3
https://www.sololearn.com/discuss/151634/?ref=app
the function behaves as the value it returns .
for example you can do
int a = func(3,3) + 2;
cout<<a;
output 8.
+ 2
as the name says itself, it returns the value of a variable, or operation.
if you call the function like:
func(2,3);
and inside it say return a + b, the return value will be 5.
0
It means you substitute every call of that function for the value it returns.