Questions tagged as 'array'

0
answers

Rename XML nodes and subnodes from an array

I have an array, which I want to transform into an xml document, I already have it created but I can not change the names of some nodes and sub-nodes, here's an example of an array to be transformed, the code that does the transformation and an...
asked by 16.02.2017 / 15:08
6
answers

What's the difference between declaring an array with "array ()" and "[]" in JavaScript?

In JavaScript we can declare an array in two ways: var matriz = new Array(); and var matriz = []; What is the difference between the two and what are their consequences? This question is being posed for the purpose of documenting...
asked by 04.03.2014 / 21:48
2
answers

Select index of an array that is inside another array

I have a ArrayList that has other ArrayList inside it, I got through the following scrip in Groovy: def i0 = listaTransportadoras.get([0]); def i1 = listaTransportadoras.get(1); logger.info(i0.toString()); logger.info(i1.toStrin...
asked by 03.02.2017 / 16:54
1
answer

How to increment the index of an unlimited array?

How can I increment an array within a structure? My structure is this: struct list { char name[50]; int products_list[]; } LIST[10]; I wanted to know the current number of elements in the array (list_products) to add more products with t...
asked by 01.01.2017 / 23:03
1
answer

Does anyone know why this program is failing?

void ordenar(struct piloto *vetor,int contador_pilotos) { int z,i,x,j; for(x=contador_pilotos-1;x<=1;x--) { for(i=0;i>x;i++) { if(strcmp(vetor[i].nome,vetor[i+1].nome)>0) {...
asked by 11.01.2017 / 16:49
0
answers

Query with arrays not working PHP SQL

To edit a report, I need to get everything and turn it into an Array. I can not use UPDATE because the user can add more rows, having to add. In this way, I thought of first to delete the data that codeReport = '$ codeReport' and then give...
asked by 26.12.2016 / 16:15
0
answers

Use split and replace array key?

By using the split function in a string obviously the keys will be enumerated from 0 to ... but I would like to choose what the key should be, using just one of the words that will be in the string, example to help simplify : $string =...
asked by 16.12.2016 / 21:50
1
answer

How to redirect to the same position of the object after the update

I'm displaying a collection of random objects in my action index. However, the objects are displayed one at a time. So: @objects = Object.order("RANDOM()").limit(1) In the view index, I can send a comment to this object, but when I submit t...
asked by 06.12.2016 / 23:10
1
answer

array type has element type incomplete

I am not able to compile my program, the compiler is accusing "array type has element type incomplete" in function that prints points. The function that prints dot: float imprimePonto(struct armazenar p[], int n) { int i; for(i=0;i...
asked by 07.12.2016 / 12:26
0
answers

OutOfBounds error

Well, I asked you to help me with this mistake! This is part of the code of a game, the idea and print anything like this M M M 123456789012345678901          1 2 The positions of the M will vary with each move, Thank you! Exception in...
asked by 02.12.2016 / 11:48