Questions tagged as 'array'

1
answer

Is this bubble sort correct?

People are reading C ++'s "Programming principles and practice using c ++ (2nd edition)" book. You have a good exercise at the beginning talking to make a program that orders the given numbers. I did it using BubbleSort, I burned a lot of neuron...
asked by 09.07.2015 / 19:13
1
answer

How to interconnect two arrays?

If I have an array: Array ( [0] => Array ( [color] => azul ) [1] => Array ( [color] => branca ) [2] => Array ( [color] => prata )...
asked by 03.06.2015 / 21:28
1
answer

Insert objects into an Array without copying them

Is there any way I can put items in Array without multiplying them? I'm trying the following. I want to add the items from the MethodList list in the toAdd list, but without repeating what is in the sourceItems list:...
asked by 04.06.2015 / 02:39
1
answer

How to find an item in a field separated by commas? [duplicate]

I have a field in a table with data separated by a comma: id_regioes: 1,2,3,4,5,6 . When I do the query "SELECT * FROM 'tb_operadora' WHERE 'id_regioes' = 1" , or "= 6" returns ok, but not when they are in 2,3,4,5. Eve...
asked by 23.03.2015 / 14:32
1
answer

How to traverse a 2-D array in C and display?

In this code, I have an array of two dimensions, I started and I want to start with printf, but I do not know how to do it: #include <stdio.h> #include <stdlib.h> int main() { int i; int matriz1 [3][4] = {1, 2, 3, 4, 5, 6,...
asked by 17.05.2015 / 02:33
1
answer

Create an existing array array

I have the following line of code: $valores = implode(", ", array_values($dados)); and by giving var_dump(array($valores)); the following information is returned:    array (1) {     [0] = >     string (26) "Igor, Teste, i@hotma...
asked by 18.04.2015 / 21:13
1
answer

Java 8 - Collect elements from a list

Good morning. I would like to collect specific elements from a list. I could do the Java 7 style, but I'm curious how I would do it in the Java 8 style. For example: [1, 2, 3], [1, 2, 3], [4, 5, 6]] = An ArrayList of Object [] Collec...
asked by 02.01.2015 / 12:07
2
answers

Organize folders, subfolders, and files in an array?

Well, I have an array with values: array("Pasta/Readme.txt", "Pasta/Subpasta/helloworld.mp3", "Pasta-2/screenshot.png"); How do I return an array like this: array("Pasta" => array("Readme.txt", "Subpasta" => array("helloworld.mp3"))...
asked by 27.12.2014 / 21:40
1
answer

XCode - array position value is not displayed

I have an array with 30 positions and in each position of the array I have several objects type: NumProcess, Name, Age, Sex, DateNation. I would like to display all these objects from each position in a single line using NSLog , but I do not...
asked by 16.06.2014 / 17:17
1
answer

Dropping a level in the array

I have an array as follows: Array ( [Fatura] => Array ( [id] => 821 [numero] => 5014 [vencimento] => 22122014 [emissao] => 22122013 [cliente_id] => 123...
asked by 21.04.2014 / 21:28