Questions tagged as 'array'

2
answers

Extract integers from a JAVA string

I have this string ( LIXA ABIMERHI JUAN JOSE,DISEÑO DE INTERFACES,90,88,81,90 ) and they are asking me: Read the data by lines using the split method of the class String separate the fields. Convert the 4 strings of gra...
asked by 24.11.2017 / 15:21
2
answers

Help with (const vectorint & t: flights), in floyd algorithm

//vector<vector<int>>& flights //vector<vector<int>> vec(n, vector<int>(k + 1)); for (int i = 1; i <= k; i++) { for (int j = 0; j < n; j++) { vec[j][i] = vec[j][i - 1]; for (const v...
asked by 12.11.2018 / 23:43
2
answers

Declare an array with a length entered by the user

Suppose I put 10 in the length of the vectors in the following code. The problem is that even if I put 10 in the length, I can only enter 6 coordinates to the vector using the keyboard. Why does that problem happen? int...
asked by 28.04.2018 / 06:25
3
answers

C ++ random number generator

The problem is the following I have my code in which it generates 10 random numbers in an array, then shows them and then orders them, what I want is that when I re-execute the "fill" function that is the that generates the numbers an arrangemen...
asked by 25.09.2017 / 20:31
3
answers

Search for repeated values in multidimensional array (PHP)

How can I get the repeated values inside a multidimensional array in PHP? I have found some functions but they have not worked for me. Is there a native function that does that? <?php $array = array(array(7,18), array(12,7), array(12, 7, 13...
asked by 09.08.2016 / 09:12
1
answer

get the objects that are repeated in an array of JSON objects with javascript (JQuery)

I give as an example the following array of objects in JSON: [{"id":"aaa","uns":"123"},{"id":"bbb","uns":"023"},{"id":"aaa","uns":"123"},{"id":"ccc","uns":"765"},{"id":"ddd","uns":"256"}]. I would like to obtain an array with the repeated...
asked by 06.06.2017 / 10:46
1
answer

String stored inside an array becomes undefined in JavaScript

I have some text strings stored in an array and I want to use them to add a CSS property to a series of images. var img = document.getElementsByClassName("post-image"); var link, w, h; var margenes = []; for (var i = 0; i < img.length; i...
asked by 18.05.2017 / 04:05
1
answer

Error Undefined offset in PHP

I need to separate the elements of an array according to their type and print them in a list. <?php $d[0] = 13; $d[1] = 133; $d[2] = 45; $d[3] = "Hice 89 lagartijas"; $d[4] = 778; $d[5] = 67; $d[6] = "Que onda"; $d[7] = 456; $d[8] = 34; $d...
asked by 19.02.2017 / 08:04
1
answer

Show array by JOptionPane and pick up result

I have a problem. I want to show an array in a JOptionPane, I do it like that. String[] continentes = { "ANorte", "ASur", "Africa", "Europa", "Asia", "Oceania" }; JOptionPane.showMessageDialog(null, Arrays.toString(continentes)); So, I sho...
asked by 16.12.2018 / 22:14
3
answers

How to convert string to char *?

I wanted to ask about how to convert a string to a char *, the case is the one shown below, where I have a defined string and I want to name the variable x using .setName (), but it receives a char *, so that I can not simply place variable name...
asked by 13.11.2018 / 18:32