Questions tagged as 'array'

1
answer

Join different arrays in the form of a tree?

I have a situation where I can not find a solution. Suppose we have two arrays as follows: array('br', 'com', 'example1' ) and another array like this: array('br','com','example2') What I would like is to turn these two arrays into...
asked by 21.05.2018 / 16:00
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
1
answer

Javascript, failed to "save" the ordering of arrays

Failed to "save" arrays sorting I have a code to sort an array and store its values in a second array, but when I order it again it modifies the value assigned to the second array and instead of appearing: Ordenamento Alfabético: Chave 0...
asked by 26.04.2018 / 20:36
2
answers

Returning direct and array function string

What works: void *teste(); int main () { printf("\nRESULTADO: %s\n", teste()); return 0; } void *teste(){ return "Ponteiro"; } What goes wrong: void *teste(); int main () { printf("\nRESULTADO: %s\n", teste()); retu...
asked by 03.11.2017 / 15:11
2
answers

Filter with TypeScript

I have the following code: search(evento){ this.str = evento.target.value; console.log('str ',this.str) this.cartoes.forEach(element => { if(element.codigo.search(this.str) !== -1 && this.cartoesFiltro.length === 0){ this.cartoes...
asked by 25.04.2018 / 06:37
1
answer

How to update a field in MongoDB

Considering the following structure: { "_id" : ObjectId("5ad69abb3630404194c80571"), "cnpj" : 2352345234523452, "razao_social" : "Lalala Ltda.", "fantasia" : " "aiufhdiua Ltda.", "dt_criacao" : ISODate("2018-04-18T01:09:15.076Z"), "usuarios" :...
asked by 19.04.2018 / 05:22
0
answers

In what way could I sort this code so that it would print the vector numbers incrementally?

//Questão 4 #include <stdio.h> #define TAM 10 int main() { int i, valorVET, VET[TAM]; printf("Digite os 10 numeros:\n"); for(i = 0; i < TAM; i++) { scanf("%d", &VET[i]); } for(i = TAM - 1; i >=...
asked by 20.04.2018 / 02:36
1
answer

How to put a value of a var inside an array item?

I'm working on Google Charts , but I came across a situation, and I'd like to know if I can do something like this: var numero = 45; var data = google.visualization.arrayToDataTable([ ['Onyx', '<valor da var numero aqui>] ]);...
asked by 12.04.2018 / 17:25
0
answers

How to structure data for JSON with PHP

I have the return of a query that brings me the following items from the following query (NOTE: they are tables created for examples) select * from alunos a left join financs f on f.aluno_id = a.id left join financ_detalhes fd on fd.financ_id...
asked by 10.04.2018 / 19:24
1
answer

Z-shaped square with array

I'm trying to make a java algorithm to display a string of letters arranged in a "Z" format. If the alphabet finishes, go back to A and continue until you finish the matrix. I'm really lost in relation to the matrix. Could someone help? An ex...
asked by 10.04.2018 / 02:34