Questions tagged as 'array'

4
answers

two-dimensional javascript array

I have to get this structure in Javascript : In it I will keep objects in the first column and in the second one an amount that will be a whole number. I have to create it with a two-dimensional array. I have tried a thousand ways,...
asked by 23.01.2018 / 05:57
3
answers

Different memory addresses?

I'm working on windows 10 and codeblocks, and my question is because by doing this I have the memory position for example 0060FEFC    1st Code #include <stdio.h> int main(void){ int arreglo[4]; printf("%p\n",arreglo); //Direc...
asked by 06.04.2018 / 10:14
2
answers

Problem with array in Python

I'm starting with Python and I have a problem with the code I'm doing ... from numpy import * import random def busquedaLineal(buscado, arreglo): encontrado = 0 for i in range(len(arreglo)): if arreglo[i] == buscado: en...
asked by 24.05.2017 / 23:54
3
answers

Compare two arrays and save value that is repeated in another array

I am trying to compare 2 arrays ( a and b respectively) and the value of a that is repeated in b that forms another vector. I have put it this way: when I want to compare the values entered in b with a...
asked by 20.06.2018 / 06:00
3
answers

Simple problems with PHP arrays

to the point, I declared an empty array, in which I intend to save random integer values using a function and this is what I did, but when doing the count ($ array), I get 0 elements. Example: $numerosJ1 = array(); numerosJugadores($numeros...
asked by 23.09.2018 / 09:03
3
answers

Doubt with arrays in C ++

I'm working with C ++ and a teacher told us in class that we can not tell an array to measure a variable int array[i]; But for example can I create a constant and tell it to measure a variable to put the constant in the array? #define con...
asked by 31.10.2017 / 19:11
2
answers

javascript string.indexOf (array) does not work with long strings

I was looking for a good time but all the questions were different from mine. I'm trying to find a string in an array where the strings within the array contain more than one word, for example: var array = ["hola soy un string", " asd hola...
asked by 09.11.2016 / 10:50
2
answers

Obtain 5 last values of an array in javascript?

I have an array: aNumeros=[1, 5, 6, 7, 8, 9, 10, 12]; I want to create another array from that, which contains the last 5 numbers: aNuevo= [7, 8, 9, 10, 12] thanks in advance     
asked by 09.11.2018 / 22:27
2
answers

Get array values within another PHP array

I have two arrays which contain the same number of values each. One contains the id of materia and the other calificaciones . I need to access the qualifications to later enter them into a database. The problem is that I c...
asked by 11.05.2016 / 18:45
1
answer

What is the typeof of 0?

I'm doing a function that extracts all the numbers from one array and stores them in another, but when I get to 0 it does not recognize it as a number, here my code: function filter_list(l) { return l.filter(function(e){ if(typeof e ==...
asked by 30.08.2018 / 13:51