Questions tagged as 'array'

3
answers

How to get multiple arrays with 1 single index and put in a single array?

I am 3 days trying to solve a problem, I can not get multiple arrays with 1 single index and put and a single array. EX: Está imprimindo assim: Array( [0]=> "MT" ) Array( [0]=> "MG" ) Array( [0]=> "AM"...
asked by 08.01.2016 / 13:25
1
answer

Retrieve standardized array object

Hello, everyone. I have a problem retrieving an object, it follows my situation: How do I do: $scope.data = []; for(var i = 0; i < 5; i++) { $scope.data.push(i); } // Result: [0,1,2,3,4] Result I need [[0,1,2,3,4]] W...
asked by 27.12.2015 / 13:47
1
answer

How to transform a java String into a Java Array Object?

On a .jsp page, I have the following code: String[] arrayRegioes = request.getParameterValues("numRegiaoUsuario");//objeto When I print the arrayRegioes , the value shown is:    [Ljava.lang.String; @ 5a879b45 Now, I need to tr...
asked by 24.03.2016 / 14:22
1
answer

Array initialization with empty list "{}" in C ++

From what I've seen, it's possible to initialize a vector with the empty list, in C ++, but not in C, so that all vector elements are 0: int meuVetor[10] = {}; // Todos os elementos 0, em C++ What I learned in this answer from SOEn. Is...
asked by 24.03.2016 / 22:40
1
answer

Implementation of priority queue using vector

I'm implementing a priority queue using a vector, so my insert method works normally: public boolean inserir(int n){ if(estaCheia()) { return false; } if(estaVazia()) { fila[nItens++] = n; return true; } else { int i;...
asked by 21.12.2015 / 00:36
2
answers

Can I use Get or Post to read an Array?

I'm trying to make an .php file read an array, but I also want to assign an id for each value in Vector. Ess is the html <form method='GET'> <input type="hidden" name="idArray[]" value="1" /> <input type="hidden" name="idAr...
asked by 09.12.2015 / 17:27
2
answers

warning for in_array coming empty

I have a code that to generate a PDF it checks what is marked in the checkbox. But if I do not mark anything, it still opens the PDF, only with the blank sheet. You can do a if that if nothing has been marked, display an alert on the sc...
asked by 28.10.2015 / 12:00
1
answer

Access memory allocated on a pointer

If I have a vector of pointers of type *p[tamanho] , where each position will be occupied by p[tamanho] = malloc(10*sizeof(int)) , how do I access each position of that vector allocated with malloc ?     
asked by 26.10.2015 / 04:53
1
answer

Function "strstr ()" is not locating what I expect

#include <stdio.h> #include <string.h> char tracks[][80] = { "I left my heart in Harvard Med School", "Newark, Newark - a wonderful town", "Dancing with a Dork", "The girl from Iwo Jima", }; void find_track(char sear...
asked by 04.01.2016 / 21:41
2
answers

How to get the values of an array from a key

I need to get the values ($ src), within this foreach, of each key separately in that array: <?php foreach( get_post_gallery( $post->id, false ) as $key => $src ) { echo $key; //resultado: link, size - ids - src...
asked by 06.11.2015 / 19:05