Top "Return" questions

A return statement causes execution to leave the current subroutine and resume at the point in the code immediately after where the subroutine was called, known as its return address.

How to return result of a SELECT inside a function in PostgreSQL?

I have this function in PostgreSQL, but I don't know how to return the result of the query: CREATE OR …

sql postgresql return plpgsql return-type
Why does "return list.sort()" return None, not the list?

I've been able to verify that the findUniqueWords does result in a sorted list. However, it does not return the …

python list sorting return
Does return stop a loop?

Suppose I have a loop like this: for (var i = 0; i < SomeArrayOfObject.length; i++) { if (SomeArray[i].SomeValue === SomeCondition) { …

javascript loops return
In JavaScript, is returning out of a switch statement considered a better practice than using break?

Option 1 - switch using return: function myFunction(opt) { switch (opt) { case 1: return "One"; case 2: return "Two"; case 3: return "Three"; default: …

javascript return switch-statement break
Returning string from C function

I haven't used C in over 3 years, I'm pretty rusty on a lot of things. I know this may seem …

c string return local-variables
Best way to return a value from a python script

I wrote a script in python that takes a few files, runs a few tests and counts the number of …

python return return-value
Return different type of data from a method in java?

public static void main(String args[]) { myMethod(); // i am calling static method from main() } . public static ? myMethod(){ // ? = what should be …

java return return-type
Gets last digit of a number

I need to define the last digit of a number assign this to value. After this, return the last digit. …

java return digits
store return value of a Python script in a bash script

I want to execute a python script from a bash script, and I want to store the output of the …

python bash return return-value
error: function returns address of local variable

I'm beginner with C and I am learning on my own. I am creating the following function: char *foo(int …

c return strcpy strcat