Questions tagged as 'array'

1
answer

Insert an element into an array that contains an object

Hello, I would like to know how to insert an element into an object in an array, in this case, when I add it with the code below, the element is inserted as another index: this.array = []; this.array.push(email); this.array.push({ Mensagem:...
asked by 29.06.2017 / 23:44
2
answers

How to change position of all matrix elements by changing the row number by column?

I tried this algorithm but the result stays the same after this exchange int[,] array = new int[10,10]; for (int l = 0; l < 10; l++) for (int c = 0; c < 10; c++) { int temp = array[l, c]; array...
asked by 14.07.2017 / 16:09
2
answers

What is my error in this code?

Hello, I'm starting to study the JS language and I packed it here, I do not know what my mistake, could someone explain to me what I'm doing wrong? <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title...
asked by 05.08.2017 / 03:47
1
answer

What is the difference between pointer to vector and pointer to variable?

int A; int* pA = 1; int Vect[2] = {1,2}; int* pVect; pA = &A; *pA = 2; pVect = Vect; pVect[0] = 10; In the case I have a pointer to a variable and then to a vector, and I want to change its values by the pointer. Why is there such a dive...
asked by 29.03.2017 / 06:31
3
answers

Calculate the average temperature in R

I have: Data Sala.1 Sala.2 Sala.3 Horas 1 02/08/2013 20.5 19.7 21.6 15:00 2 02/08/2013 19.7 18.9 20.2 15:30 3 02/08/2013 19.7 19.1 20.0 16:00 4 02/08/2013 19.7 18.8 19.8 16:30 5 02/08/2013 19.8 18.8 19.9...
asked by 27.03.2018 / 19:31
1
answer

Problem with vector return in c ++

I'm trying to do a program to sort vector and I'm using an auxiliary function to do this, but I'm getting this error message. /media/isaque/dados/exercicios/c/scripts/estrutura de dados com c++/busca_binaria.cpp: In function ‘void ordenar_veto...
asked by 27.03.2018 / 19:28
1
answer

How to output the index of my array in C?

I have a program that will check 9 numbers and say which one is the largest of all, and for this I am using vetor already filled with values, and am using a for to go through all vetor e look for the greater. The problem is...
asked by 24.06.2017 / 15:45
1
answer

Remove subArray from a Main Array

I have two main Arrays ( listaInformacoesNota , listaInformacoesPedidosPostgreSQL ) with N subArrays each, these subArrays have items in common and a different item only, I did the following to compare these each subArray: fo...
asked by 15.09.2017 / 14:12
1
answer

doubt Array.push () Javascript

Hello! Can anyone tell me why the push method is only saving the last item in the newArr array? My goal is to extract an array with the permutation of the passed values and in console.log() it comes out right, but when I try to th...
asked by 02.02.2017 / 19:04
2
answers

Display associative array elements with foreach

Hello everyone. I would like to display the elements of an associative array as follows: Nome: José Idade: 32 Profissão: Médico Nome: Rafaela Idade: 28 Profissão: Dentista All this on the same page. And the code I'm using is as follows:...
asked by 05.03.2017 / 07:28