Questions tagged as 'array'

1
answer

How to store vector values?

I am a beginner in C and I am 2 days into this exercise, I was able to do it so that if you increase the vector with the realloc function, it will increase everything right, but I need it to save the values you typed . For example, I w...
asked by 25.06.2017 / 14:13
2
answers

Create dynamic variables in JavaScript

When I'm in PHP and have dynamic variables, ex: nomeVariavel1 , nomeVariavel2 , nomeVariavel3 , I use the following way to put in the bank: $nomeVariavel = ${"nomeVarivavel".$contador} How can I do exactly this in J...
asked by 26.05.2017 / 18:23
1
answer

How to access variables of another class of objects by array?

I have 2 Classes, which are: Path and Costs . Path : public double getKmPercorrida() { return kmPercorrida; } public void setKmPercorrida(double kmPercorrida) { this.kmPercorrida = kmPercorrida; } public double getValorCombustiv...
asked by 09.12.2016 / 02:47
1
answer

TByteDynArray for String Delphi 7

I have a method to convert a base64 file that returns a TByteDynArray, and I wanted to convert this TByteDynArray to String. I've tried it in some ways and it's not working. Error:     
asked by 11.04.2017 / 00:18
1
answer

Return local variables of the function

I have two methods: // Apenas define um vetor de 4 posições e retorna ele int *verticesFromFace(int v1, int v2, int v3, int v4) { int vertices[4] = {v1, v2, v3, v4}; return &(vertices); } // pega um cubo e uma face dele, retorna um ve...
asked by 10.11.2016 / 17:39
1
answer

Php array check for values or keys

[TotalPed] => Array ( [VlrTotalIPI] => 0.00 [VlrTotalItens] => 652.68 [VlrTotalDesc] => 0.00 [VlrTotalPed] => 652.68 [PercComPed] => 0.00 [PercComPed2] => 0.00 [VlrF...
asked by 10.11.2016 / 01:54
2
answers

Search for something in a list and say whether it exists or not - Display Value, and sum of quantity

Good afternoon, what is the easiest way to make a list that contains multiple items, for example meat, fish, pao etc, and from the $ _GET multi-item know whether the product exists or not? I tried to create an array and do with array_key_exist b...
asked by 08.07.2016 / 19:00
1
answer

Multidimensional array from mysql query

Good afternoon, I have a system, with the following tables: pagina: id,nome ,icone, idGrupo. paginaGrupo: id,nome,icone, idGrupoUser. I am putting a dynamic menu on top of these tables. I get the ids of the groups that the user is part o...
asked by 19.09.2016 / 17:38
2
answers

PHP global array as temporary table

I'm in the middle of a problem, I'd like to use a array as a temporary table, more or less like this: $array = [ "codigo" => "0123", "descricao" => "produto" ]; But I would need it to be global , but I have many d...
asked by 13.10.2016 / 15:13
1
answer

Join php arrays by allocating combined values between the two

I have the following arrays: $corretor = array( 'Carlos', 'Andre', 'Rosinei', 'Vinicius', 'Thales' ); $comissao = array( 5, 3, 3, 3, 2 ); How do I merge both, printing the result as follows:    Carlos - 5% | Andr...
asked by 09.05.2016 / 19:36