+ 1

What's return value really mean? Why return value called return value and how it works?

19th May 2019, 4:27 AM
D Ģ²E Ģ²S Ģ²S Ģ²I Ģ²E Ģ²- Ģ²B Ģ²A Ģ²H Ģ²I Ģ²R Ģ²U Ģ²
D Ģ²E Ģ²S Ģ²S Ģ²I Ģ²E Ģ²- Ģ²B Ģ²A Ģ²H Ģ²I Ģ²R Ģ²U Ģ² - avatar
4 Answers
+ 21
The return type of a function tells what kind of value a function is supposed to return to the point from where it is called. However, if you use 'void' as the return type of a function, it doesn't need to return anything. It just performs the work written through the code, and returns the control back to point from where it was called. ā–Ŗreturn x; causes the current function to return to the caller, evaluating to x. It is required except in functions returning void, in which case return; returns without a value.Ā 
19th May 2019, 9:13 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 12
TheĀ returnĀ statement terminates the execution of a function and returns control to the calling function. Execution resumes in the calling function at the point immediately following the call. AĀ returnĀ statement can also return a value to the calling function So it called return dramatically because of it's grammatical meaning , it means to stop where you are and turn back your way from where you came from and in our case we will come back to "the calling function" and as I said sometimes we don't turn back our way with empty hands , we can come back with a value so it may seem funny the metaphor but that what "return"really do
19th May 2019, 4:46 AM
Why So Serious ?
Why So Serious ? - avatar
+ 10
In most programming languages, the returnĀ statement is eitherĀ returnĀ or return value, whereĀ valueĀ is a variable or other information coming back from the subroutine
19th May 2019, 4:52 AM
Why So Serious ?
Why So Serious ? - avatar
+ 4
return simply means to get the output of a function, you return a value back to were that function was called.
19th May 2019, 8:01 AM
D_Stark
D_Stark - avatar