Top "Return-type" questions

is for questions dealing with the type of the variable or value returned by a function.

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
How do I make the return type of a method generic?

Is there a way to make this method generic so I can return a string, bool, int, or double? Right …

c# .net generics return-type
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
Apply pandas function to column to create multiple new columns?

How to do this in pandas: I have a function extract_text_features on a single text column, returning multiple …

python pandas merge multiple-columns return-type
C++: variable 'std::ifstream ifs' has initializer but incomplete type

Sorry if this is pretty noobish, but I'm pretty new to C++. I'm trying to open a file and read …

c++ fstream return-type
Return from lambda forEach() in java

I am trying to change some for-each loops to lambda forEach()-methods to discover the possibilities of lambda expressions. The …

java foreach lambda java-8 return-type
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
Can two Java methods have same name with different return types?

Can two Java methods have the same name with different return type? The return type of the methods are different …

java methods return-type
Returning anonymous type in C#

I have a query that returns an anonymous type and the query is in a method. How do you write …

c# .net anonymous-types return-type
Nullable return types in PHP7

PHP 7 introduces return type declarations. Which means I can now indicate the return value is a certain class, interface, array, …

php nullable return-type type-hinting php-7