Questions tagged as 'array'

1
answer

How to make a method return a string in Java

I want to create a program that reads the name and age of a person and compares the ages and finally shows the name of the oldest person. My rationale was to compare which is the largest and return the index of the position of the array . But t...
asked by 08.09.2017 / 20:46
2
answers

Doing searches and comparing java

I am developing a program that should request the RA of a student, the RA must be greater than zero. Soon after I want to buy the second RA typed to check if it has not already been registered. I made the code below but it keeps letting me regis...
asked by 06.06.2017 / 16:00
1
answer

How to properly use memcpy? [duplicate]

I'm trying to create a program that will have two vectors: char vetor_origem[20] = "algoritmo"; char vetor_copia[20] As you can see, in vetor_origem I have the word algorithm written, and I want to copy the string from it to vet...
asked by 19.06.2017 / 17:39
2
answers

Get any variable of an array that has a certain id in AngularJS

With the following code, I am saying that in the second array contained in the object $scope.listademercadoria there is the property "quantity", and I am declaring it as value 0. $scope.listademercadoria[1].quantidade = 0; Is there a...
asked by 12.10.2017 / 06:43
1
answer

Find repeating numbers in lists with Visualg

   Write a program that receives 100 numbers entered by the user. At the end the program displays how many numbers you enter are the same as the last number entered. As far as I can go: algoritmo "semnome" // Função : // Autor : // Data :...
asked by 31.05.2017 / 03:59
2
answers

fill array to generate json javascript

I need to fill in a multidimensional vector to transform into json, I can not think that the last value is always overwriting the previous array_fotos = { "id": 1, "foto": imgName, "tamanho": $(".tamanho_fotos").val(), "quantidade": $("[name='...
asked by 09.03.2017 / 20:16
1
answer

Create arrays according to "exploded" strings

I have the following array: Array ( [0] => 1-6 [1] => 1-7 [2] => 2,9 ) I would like to group it according to their initial number. Example result (I'm not sure of this syntax, but just to give the example): Array...
asked by 17.02.2017 / 18:30
1
answer

Vector and matrix ordering [closed]

Is there another method for ordering array / array in ascending or descending order without being what I used? (What would you change in this code to make it "better"?) #include <stdio.h> #include <stdlib.h> void ordem (int vetor[...
asked by 25.10.2016 / 16:15
1
answer

How to replace values by NA using element encoding (and not position)?

I am having difficulty replacing values in a vector by NA, but using the treatment coding (not the position). A simple and hypothetical example of my problem is (my dataset is very large and I have several sets, so I can not do manual): filhos...
asked by 10.08.2016 / 16:32
1
answer

Return amount of PHP Array responses

I have the following array (): Array ( [0] => stdClass Object ( [men_id] => 3 [usu_id] => 2 [usu_destino] => 2 [id_resposta] => 0 [usu_respondeu] => 0...
asked by 19.11.2017 / 13:57