Questions tagged as 'array'

1
answer

How to insert a variable into an array?

I want to insert data into my database I'm using mysqli, I need to know how I would indicate an array inside a variable, here and my code I want to know if this is the correct way to do it require 'config.php' require 'connection.php' $nomear...
asked by 19.12.2016 / 20:37
1
answer

How to move ArrayList with child class

Next, I have a ArrayList of type Student (which is an abstract class), and I have two child classes ( EstudanteGraduacao and EstudantePosGraduacao ), when I add them to ArrayList is quiet, but how do I go through it wi...
asked by 20.05.2015 / 07:38
1
answer

Find in an array the next value greater than a pre-defined value

I have the following array with forech defined: $getdepth = '{"result":"true","asks":[[20,13],[34,20],[30,8],[35,8],[4,40],"bids":[["18",22],["16",74],["70",99],["65",18],["1",15]]}'; $depth = json_decode($getdepth, true); foreach ($depth['ask...
asked by 05.04.2014 / 02:30
0
answers

Is it possible to get an item from a json array to change an attribute of a rect in raphaels.js? [closed]

I would like to make an array that could serve as a database for my map represented by these 3 rectangles. The array will contain numbers that will serve as indicators for the colors of the rectangles. If item 1 of the array is 0, rectangle 1 wi...
asked by 11.06.2014 / 20:03
2
answers

Looping on an array to always choose the next value

I have an array of users and I need to loop between them. It will work like this, every time someone makes a request on the page, I need the next user to be saved in the database of the one that was previously chosen. This is my array, which...
asked by 11.03.2014 / 22:52
2
answers

What determines a variable as an array in Python?

I'm studying about queues in Python and I'm using the object deque of the module collections . So, in Python I can access the values of an array by index simply by typing: array = [1, 2, 3] arra[0] # 1 However, the deque o...
asked by 04.09.2018 / 21:14
4
answers

Fill fields in a multidimensional array with null

I have this code that returns this array and if you notice, you can see that there are empty fields. What can I increment in this code so that where the index is empty receive the value null ? This works, but for my multidimensional...
asked by 07.09.2014 / 02:45
2
answers

How to insert multiple values into an array?

A student can take several courses such as "English", "Portuguese", etc. How do I put multiple course names in an array ? I do not want to make the example with ArrayList . It's just to take one of my questions for granted. So I have to c...
asked by 16.01.2016 / 20:05
2
answers

Pointers and arrays picking up something not expected

#include <stdio.h> int main() { int vetor[][3] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; int valor= *(vetor[1] + 1) + **(vetor + 3); printf("%d", valor); } The code above was taken from theoretical exercises, but I do not h...
asked by 25.09.2018 / 19:32
2
answers

Subtraction of arrays

I have two arrays : A E B A = [1,2,3...] B = [7,5,1...] When I do this subtraction it has the correct subtraction return: console.log(A[0] - B[0]); But when I play in the loop it does not work: while (i = 0) { A[i] - B[i] }    ...
asked by 23.11.2018 / 12:09