Questions tagged as 'return'

1
answer

How to return or extract more than one value from a function?

integerPower( int y ){ int base2; int base3; int base4; int total; base2 = pow( y , 2); base3 = pow( y, 3); base4 = pow( y, 4); When I call this function (I did not type return because that's the question) I...
asked by 13.12.2016 / 00:44
1
answer

How to return more than one value using an asyncTask in android?

In short, my class that extends an AsyncTask, downloads a series of data of type byte, then I need to perform some calculations with that data, and finally return all these values to my MainActivity. The code is summarized as follows: class...
asked by 22.06.2015 / 13:32
2
answers

How do I access the indexes of a vector returned by a method in java?

I have a method called vetorVoos that returns a vector of type NodeVoo and I want to access the contents of that vector through the method in another class. This is the method: public NodeVoo[] vetorVoos(){ if(isEmpty()){...
asked by 04.05.2014 / 01:03
2
answers

Return with 2 Values C # [duplicate]

I want to give return of two values in C #. My code is so currently, just returning imagePath , but I want to return imagePath and normalPath at the same time. string imagePath = "~/Images/QrCode.jpg"; string norma...
asked by 18.04.2018 / 18:36
4
answers

How to return 2 variables from a function

I'm accessing a webservice , which returns: listProdutos[] - > List of all products or null when there are no products When I lose access for some reason, it throws an exception, and in that case I need to return a second...
asked by 05.11.2014 / 17:59
2
answers

Put method return before a "finally" block

Considering: try { System.out.println("Parte 1"); return false; } finally { System.out.println("Parte 2"); } What will be the output and what happens underneath the cloths so that the output goes out like this?     
asked by 29.11.2014 / 01:35
2
answers

Factor function in C does not return result

What's wrong with my code? int fatorial (int n, int num, int fat) { if(num >= 0) { fat = 1; n = num; while(n > 0) { fat *= n; //FATORIAL = FATORIAL*N n--; }...
asked by 21.02.2017 / 14:08
1
answer

Wait for variable value to return function

I'm trying to create a function that turns a file into a Data URL. But I'm facing a problem: The return value of the function is not what I expected. Here is my code: File.prototype.toData = function() { //Leitor de Arquivos va...
asked by 13.06.2016 / 06:54
1
answer

Use closure as a function return

I need to use a variable of a closure as a function return to which this closure is nested. How can I do this? response must be the return of ajaxRequest() : function ajaxRequest(type, url) { const ajax = new XM...
asked by 21.12.2016 / 20:42
2
answers

Can I return a struct by initializing it inside a return in ANSI C?

Good morning, I'd like to know if I can do something like this ... typedef struct Result { int low, high, sum; } Result; Result teste(){ return {.low = 0, .high = 100, .sum = 150}; } I know this would not be a right way, but is there...
asked by 06.09.2014 / 15:36