Questions tagged as 'array'

2
answers

Obtain specific result within an array

I want to get the id found within this array : Array ( [count] => 386 [items] => Array ( [0] => Array ( [id] => 293259195 [first_name] => Ana [last_name] => Nidegger ) [1] => Array ( [id] => 320180374 [fi...
asked by 16.10.2018 / 11:40
1
answer

How can I add two long integers passed as a string? c #

First of all, I want to thank you for your time when it comes to reading my question. I am new to c # and in programming in general, and I am having problems with something simple. I want to add two long integers as a string of text, I have reac...
asked by 06.07.2018 / 20:25
3
answers

Add values of a two-dimensional array and throw your total PHP

There is a method (array_sum) in PHP that adds the values of a two-dimensional array without having to traverse the array, but in this case I need to traverse that array without using this method to display the values per array and its total ....
asked by 13.05.2018 / 06:47
2
answers

Doubt with POO exercise in Java - problem with array

I have a question with an exercise that says: Create a Book class with loan, return and toString methods. I want the vector to grow as the number of books grows, but in codigo.length , codigo appears as not being initialized. Wha...
asked by 03.03.2018 / 23:39
2
answers

Calculate the length of each string within an array with the .map method

Good morning, I'm not sure how the map method works, does one function for each element of array as foreach ? Thanks I would like to know how to do this = > Take an array of strings and turn it into an array of num...
asked by 08.12.2017 / 15:42
1
answer

How to traverse a JSON array in PHP

I need to run a JSON array in PHP Query URL: link { "coError": "0000", "coRpta": null, "feCaducidad": "05\/12\/2019", "listaTramites": [ { "nomTramite": "Rectificaci\u00f3n", "tiTramite": "R", "feTramite": "09\/...
asked by 09.12.2017 / 02:13
1
answer

Combinations / possible pairs in the same array

I want to pair all the elements of the same array together, but one element can not be paired with itself. The code I got is the following: function combine(list) { var pairs = new Array((list.length * (list.length - 1)) /...
asked by 13.11.2017 / 12:31
2
answers

c ++ error expected initializer before 'void' when compiling main [closed]

I have a doubt with a class in which I implement a vector with all its functions, what happens is that when compiling, in the main I get an error that I do not understand, I have reviewed my code and I can not find an error. This is th...
asked by 09.02.2018 / 02:07
5
answers

Swapping two objects by changing the result in JavaScript

I have two objects, and I want to return them permuted in JavaScript , that is, if I enter a and b as arguments, I return [b,a] , changing the order . But I do not want a function that only returns the permuted result, bu...
asked by 08.07.2017 / 04:38
2
answers

Random elements of an array

I have problems with this code that I try to execute: $buscar = array("necesito 01","necesito 02","necesito 03"); $resul = $buscar[mt_rand(0, count($buscar) - 1)]; $query = array( "q" => "'+$resul+'", "count" =>...
asked by 07.07.2017 / 08:06