Questions tagged as 'array'

1
answer

Access values within an array from the index

I have a x variable with the following content inside: x = [ { id: '1', name: 'name, } ] And I thought that to access id was x.id , but it is not so. How to access?     
asked by 22.05.2016 / 20:24
1
answer

How to declare and initialize two-dimensional arrays?

I have to save the row, column and contents of a worksheet. For this I created a two-dimensional matrix. My difficulty is how do I initialize it? I believe the statement is no longer correct because I get ArrayIndexOutOfBoundsException . I...
asked by 15.04.2015 / 14:59
1
answer

Is there any way to assign values to a vector faster?

For example, I have the declaration of the following vector: float vet[3] = {1, 1, 1}; I would like to change all values of the same one at a time, without having to change one by one element or create a new vector and assign to it: vet[0...
asked by 10.11.2016 / 14:50
2
answers

PHP: elements with and without explicit keys in the same array

I'm trying to figure out a better or cleaner way to do something like this in PHP: // Isto será passado como argumento de uma função... $params = array('Nome', 'Idade', 'Mail' => '[email protected]'); "Name" and "Age" are values with keys a...
asked by 31.07.2014 / 16:43
1
answer

Visual Basic Excel - Delete an array name

I'm here with some problems, I never moved in Visual Basic and was seeing if it helped me to make a listing that I have in Excel faster (Through Visual Basic Excel). It's very simple, I just want to look in the array if you have a word that h...
asked by 29.07.2015 / 19:12
1
answer

How to use a variable in array_walk?

I am trying a solution without going through "manually" ( foreach ) an array, to add in the subarrays, a new pair of chave => valor . With array_walk I can invoke a callback and treat the array but how do I pass a variable...
asked by 12.09.2016 / 18:54
1
answer

Java ArrayList - Overriding values

I need to perform the following activity: Consider an application to store the following person data in an address book: name, address, and telephone. Specify a TAD to store the people data and the operations required to enter, query, and dele...
asked by 28.02.2015 / 21:02
2
answers

Char pointer or char array?

There is a program I took in a company where pointers of char , type char* , and then allocated a memory for it with malloc , done the operations and in the end deallocated this memory. Usually receives all characters, up to ma...
asked by 03.03.2016 / 14:21
1
answer

I can not insert data into the array

I linked two drives to this product, but when I select it I have no way of linking to another new drive, since% is done at all, not being distinguished a new record that I try to link to As below, I am trying to register the drive code P1, af...
asked by 31.10.2017 / 20:46
1
answer

Difference between compact function and literal array assignment

According to the PHP documentation, the function compact .    For each of the passed parameters, compact() looks for a variable with the name specified in the symbol table and adds it to the output array so that the variable name...
asked by 09.12.2016 / 20:09