Questions tagged as 'array'

3
answers

How to change a PHP array key

I need to change the key of an array $task=array('Title' => 'Test', 'Description' => 'Description test') I need to change the name of the key Description Is there any way? I'm working with the Laravel framework     
asked by 01.10.2018 / 20:32
3
answers

How to pass a struct vector by reference parameter?

My question is, what is the error of this passage? It looks like the (*dadosCliente+i) pass is incorrect, does anyone know why? struct cliente{ char nome[50]; char endereco[50]; } void addCliente(struct cliente *dadosCliente, i...
asked by 03.02.2014 / 17:48
2
answers

Problem with pointer and array

I wanted to print the corresponding places and values from an array using a pointer, but when I ask the pointer to add the location of the vector with 8 (which corresponds to the 8 bits of an integer) program sums up values that I do not even kn...
asked by 06.10.2017 / 05:05
3
answers

Change object value

I have an array with objects similar to this: [{ name: '2015', data: [...] color: 'orange' }, { name: '2016', data: [...] color: 'red' } ] I would like to change the value of na...
asked by 01.11.2016 / 13:57
2
answers

Generate random numbers

I have the following problem: I need to generate a random number between 1 and 6 Assign a array of numbers if this new one is not contained in array If contained, regenerate. Do this process until the array of numbers has 6 numbers...
asked by 12.01.2016 / 12:14
4
answers

Object reference not set to an object instance in array

I have a problem. I have to do a rental program where you tell the data of 5 movies, and then the program lists all the information! And it's mandatory to make a class for this! I have already done the class DadosFilme , and instanciei...
asked by 06.09.2018 / 20:26
2
answers

How to organize an Array by Date order?

I'm trying to organize an array by ascending date order. I was thinking of cutting the parts using the (/) bar and compare it with the other parts, but I do not know if that's the best way to do it. I need to organize the array below:...
asked by 28.02.2018 / 22:55
3
answers

arrays equality in Java Script [duplicate]

Good afternoon, I have this little program: let oi=[1,2,3,4] let xau=[] xau=oi xau[2]=7 console.log(oi) My problem is that when in the console the output is: [1,2,7,4] According to what I understand, xau should be a new instance th...
asked by 06.03.2018 / 19:50
3
answers

Add array number and list it

What is the simplest way to do with array a kind of bank where I put a value in an array and show the same later. My problem is to modify the array , where the initial value would be 0 and hence as it is deposited the value will increase ba...
asked by 01.02.2018 / 18:44
1
answer

Concatenate parts of variable names

I have a for loop, and I want to create multiple arrays with a different name than the for increment. I try this, but it is not possible. for($y=0; $y<=1; $y++){ $newarray_date.$y = array(); $newarray_time.$y = array...
asked by 07.01.2015 / 13:15