Top "Return-value" questions

Return value is the result of evaluation of a return statement.

How do I return multiple values from a function?

The canonical way to return multiple values in languages that support it is often tupling. Option: Using a tuple Consider …

python coding-style return return-value
How to return a result from a VBA function

How do I return a result from a function? For example: Public Function test() As Integer return 1 End Function This …

excel vba function return return-value
How do I make the method return type generic?

Consider this example (typical in OOP books): I have an Animal class, where each Animal can have many friends. And …

java generics return-value
How to return 2 values from a Java method?

I am trying to return 2 values from a Java method but I get these errors. Here is my code: // Method …

java function return-value
How do I execute a command and get the output of the command within C++ using POSIX?

I am looking for a way to get the output of a command when it is run from within a …

c++ process posix system return-value
Difference between return and exit in Bash functions

What is the difference between the return and exit statement in Bash functions with respect to exit codes?

bash function return-value return exit
How can I return two values from a function in Python?

I would like to return two values from a function in two separate variables. For example: def select_choice(): loop = 1 …

python list function return return-value
Return value in a Bash function

I am working with a bash script and I want to execute a function to print a return value: function …

bash function return-value
Returning value from called function in a shell script

I want to return the value from a function called in a shell script. Perhaps I am missing the syntax. …

shell return-value
What should main() return in C and C++?

What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void …

c++ c return-value main return-type