Questions tagged as 'array'

2
answers

How to join the values of an object of a json to an array

I have this JSON. [{ GRUPO1: '3096', PER1: '0', PER2: '0', PER3: '0', PER4: '0', PER5: '0', PER6: '0', PER7: '3096', PER8: '0', PER9: '0', PER10: '0', PER11: '0', PER12: '0', TOTAL:...
asked by 29.08.2016 / 19:50
2
answers

"splice () offset past end of array" in different versions of Perl

Today, in my work, I wrote something like that, in Perl: my @x = qw( 1 2 3 4 5 ); splice(@x, 10); and the error occurred:    splice () offset past end of array at ./x line X. But on my personal laptop, there is no error like that. I...
asked by 30.10.2015 / 16:37
4
answers

Wait for a for each with ajax requests to finish to continue

I'm doing forEach in a array but this loop has an ajax request inside for each repetition and I need to wait until all the ajax are ready to continue ordering the array that is filled with these requests, this It's my code. var g...
asked by 13.09.2018 / 18:50
4
answers

Get object of an array by providing an attribute of the object

I have an array of objects like the following: var nicknames = [] nicknames.push( {id:"100", name:"Juan"} , {id:"200", name:"Mateo"} ); How can I get the data of one of the objects in the nicknames array by supplying the name or the...
asked by 06.12.2015 / 09:28
2
answers

Is it correct to use the same array as input and output in sprintf?

I found the following code: char query[255]; sprintf(query, "SELECT NOMBRE, "); switch (tipo) { case TIPO_1: sprintf(query, "%s ID", query); break; case TIPO_2: sprintf(query, "%s APELLIDO", query); brea...
asked by 13.01.2016 / 16:02
3
answers

Touring java arrangement efficiently

Lately I wanted to start thinking more than solutions, to be effective at the time of programming. And that is why I run into the following question, and as the title says: What is the most efficient way to traverse an array in Java? And...
asked by 13.04.2017 / 14:36
3
answers

Replace value in PHP array and call it later

I have a query and it is as follows. My goal is to replace the values of all fruits to increase the price by 5%: // precios originales $precios = array ( "frutas" => array ( "manzanas" => 15, "peras" => 5, "naranjas" => 3...
asked by 11.02.2016 / 02:28
2
answers

C ++ Problem printing matrices

I want to do this problem: link    Problem       Given a square matrix of size "n", you must do   that your program turns it 90 degrees to the right.       Original matrix 1 2 3 4       Matrix Rotated 90 ° to the right 3 1 4...
asked by 06.10.2016 / 05:02
1
answer

Character strings as pointers in c

I am learning C and I understand perfectly the pointers and their relation with the arrays, but my problem comes with the character strings. We declare a string of characters like this: char cadena[] = "Hola"; is equivalent to: char caden...
asked by 25.08.2016 / 20:43
2
answers

Doubt about the class vector

In an array the name of the array is a pointer to the array. So in iArray and &iArray[0] you get the same value. What I do not understand very well, is that it is happening when I try to repeat this same with myvector ....
asked by 10.05.2018 / 00:58