Questions tagged as 'array'

2
answers

Error when trying to join vectors

I want to join the vectors vector1 and vector2 into a single vector vectorUnion #include<iostream> using namespace std; void muestraVector(int v[], int longitud); void unionVectores(int vector1[], int longit1, int ve...
asked by 23.02.2018 / 20:25
1
answer

Error when comparing if: "java: bad operand types for binary operator"

I have a small problem in which I try to compare an array with an int option in an IF entered by the user, I get an error. I do not program everything in the Main and I use several classes and I communicate with each other. I would like to ma...
asked by 29.05.2018 / 22:38
1
answer

Make the average of three values of an array in Java

I want to get the average of three notes entered in an array: Code: System.out.println("\nIntroduca notas correspondientes(1-10)"); for(j=0;j<3;j++) { do{ System.out.print("Nota "+(j+1)+" : ");...
asked by 26.08.2017 / 17:44
1
answer

Moving an array in Java

I have an array with integers int[] intColorArray = new int[3]; I would like to obtain a different value sequentially of the array but if you reach the end that you get back from the beginning, that is 0,1,2,0,1,2,0,1,2... I ha...
asked by 12.08.2017 / 21:16
2
answers

List index out of range

I am writing a code in Python that lists items in an alternative way. For example: [a, b, c], [1,2,3] → [a, 1, b, 2, c, 3]. But I get an error "List index out of range". This is my code: def unir_listas_alterno(lista1,lista2): nuevaLista =...
asked by 13.11.2017 / 17:26
2
answers

create a class to load an NxN matrix into C #

I do not know how to declare the attribute of the matrix without dimensioning it, since the dimension would be entered by keyboard.     
asked by 21.06.2016 / 01:02
3
answers

I would like to order an array that I create from mysqli_fetch_array

Greetings friends, I would like to know how to order a list that you create from a mysqli_fetch_array . Apart from this code I have a search engine, what I want is that the results of the search appear in a specific row, for example cod...
asked by 23.06.2016 / 00:29
1
answer

Group by matches in a PHP array

I have a multidimensional array with indexes, in which I keep the data, about a user and their stops, this I show for days. I am interested in the days that have the same stops are grouped. The array I get from two SQL queries in this way:...
asked by 17.05.2017 / 10:29
3
answers

save several parameters in a single session

I have a question with PHP , I make a form with only input , and with 2 buttons, one to save and another to collect. The idea is that when you click on the save button, it will be stored in $_SESSION , as many variables as y...
asked by 18.02.2017 / 11:20
1
answer

How to apply a function to an array

I need to apply a function to a variable that returns this array: "content_block_images": [ { "image": 10741 }, { "image": 10742 } ] But this function only accepts that you enter the id simply tha...
asked by 23.11.2016 / 19:42