Questions tagged as 'array-multidimensional'

1
answer

Get filenames and put char array

How do I get the names of the files in a directory and put them in a multidimensional char array? #include <stdio.h> #include <dirent.h> int main() { char arrayNomes[10][50]; char dirn[50]; DIR *dir = NULL; struct...
asked by 24.06.2017 / 21:11
1
answer

Adding values from an array

I'm trying to make this code, which is basically a 6x6 two-dimensional array with the distance between 6 cities, then collect the route the user made in a simple array [6], and calculate the total miles that he traveled. The code: package r...
asked by 23.04.2017 / 00:06
1
answer

Foreach and multidimensional associative array with only one item

All good personal, I'm facing a problem with foreach in PHP, where I get an xml and convert it to array. In some cases xml has only one item (see example below) <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> <bloco...
asked by 29.11.2016 / 15:57
1
answer

Iterating in a multidimensional array

<?php $data = array(); //questoes de user 1 $data['rows']['questions'][1] = array( array('id' => 1, 'type' => 'radio', 'name' => "Onde fica ilha de Santiago"), array('id' => 2, 'type' => 'radio', 'name' => "Onde fica...
asked by 28.04.2016 / 02:09
0
answers

How to send only one row of a multidimensional array to a function?

I need to send only one line of a multidimensional array as a parameter of a function , without having to transfer this line to another array . For example: call: var UmArray : array [0..4, 0..20] of integer; begin //preenche o arr...
asked by 21.03.2016 / 23:09
1
answer

set :: sort CakePHP array

I need to sort an array in cakephp according to the order passed by parameter. The code that does the sort would be this: //Realizar a ordenação de acordo com o que receber do formulário no ajax if ($this->request->data['Adverte...
asked by 08.05.2015 / 15:36
1
answer

Save user input in a loop [closed]

I want to get the list of the variable numeros , generated by the following loop: Scanner kb = new Scanner (System.in); double [] numeros= new double[10]; for (int i = 0; i < numeros.length; i++) { System.out.println("o proximo nu...
asked by 23.09.2016 / 14:09
1
answer

Update with Multidimensional Array

I have a terrible problem, I can not update mysql via PDO, with array coming from some form fields. I've tried a lot and so far I can not do the update. The array comes in this format. Array ( [id] => Array ( [0] =&g...
asked by 01.06.2015 / 21:09
2
answers

PHP - associative array: check the amount of elements inside a value (that has an array) of a key [closed]

I have an array like this: $array = array( user => "user1", name => "name1", books => "book1", "book2" ); I want to go into books and check the value that elements have inside it, in case it would be 2 (book1 and book2)...
asked by 03.09.2018 / 20:47