Questions tagged as 'return'

4
answers

Why can not we return a void call on a method that expects void return?

I was doing C # tests to find out how the void return issue works. I did the following test below and realized that tests 1 and 3 work perfectly, but 2 does not. See: public class Program { public void Test1() { }...
asked by 06.12.2017 / 20:02
2
answers

What does "return" do in Python?

What "really" return does in Python, especially in recursive functions. Ex. Factorial: def fatorial(n): if n==1: return n return fatorial(n-1) * n     
asked by 26.02.2016 / 03:32
2
answers

How does an anonymous type return?

I have a method that should return a collection of anonymous objects: /*Aqui deveria ser o tipo anonimo "AnonymousType"*/ [AnonymousType] ListarAnonimo() { //Especifica um "template" para o tipo retornado. var lista = new[] {...
asked by 11.02.2017 / 22:12
1
answer

What does the term "String ... string" mean in Java?

What does the term String... string mean in Java? And how to construct a method that returns a String... as an example: public String... getStrings(){ return String... s;) } I know it's not that way, but I wanted to know...
asked by 01.02.2016 / 14:52
2
answers

Firefox complains of code after the return

Situation I was performing some maintenance on JS. And a certain function put a return in the middle of it, because the rest was no longer necessary. In seeing the comment on the rest or delete, I kept the code there. When reloading th...
asked by 10.11.2015 / 15:20
1
answer

Should we neglect the return of functions in C that already receive the desired value by the parameter by reference?

Looking at the documentation from scanf() I saw it return a value, but I see the codes using her without making use of this return. Is this right?     
asked by 13.03.2017 / 14:35
0
answers

Javascript: why does eval ("023") return 19? [duplicate]

I know that the function should not be used indiscriminately, because it has several security implications, as can be seen here: Is Eval a Good Guy or a Bandit? But I was doing a simple calculator, where the text of the input, after tr...
asked by 28.03.2017 / 19:04
3
answers

Is it possible to offer return options in a method?

As I already know there is overload in creating the methods, which are example, a method where you have the option of passing 2 or 3 parameters calling the same function: //Soma 2 numeros public int Somar(int a, int b) { return a + b;...
asked by 14.08.2017 / 20:24
1
answer

Return 0 on Linux and Windows

I'm starting the ADS course and my programming teacher insists on using return 0 at the end of the function. Most use Windows, I realized that return 0 is required in Windows but in Ubuntu (which is what I use) I do not put retu...
asked by 01.09.2017 / 04:57
2
answers

Returning direct and array function string

What works: void *teste(); int main () { printf("\nRESULTADO: %s\n", teste()); return 0; } void *teste(){ return "Ponteiro"; } What goes wrong: void *teste(); int main () { printf("\nRESULTADO: %s\n", teste()); retu...
asked by 03.11.2017 / 15:11