Questions tagged as 'array'

2
answers

invert push order

I'm using push in a request to put new element in a list, but I noticed that push puts the last result down. I want to reverse this. I'm using v-for to list, but I believe the "fix" will be in the same push ... follow the code: dados.ret...
asked by 12.09.2018 / 22:52
3
answers

Extract Array data in Javascript

I have array with the workgroups that the session user belongs to, for example if I write like this: return $data.teste02[0].group_id.name It returns me the first group that this user belongs to, which in this case would be administ...
asked by 28.08.2017 / 15:38
3
answers

Displaying data in a table with foreach

I'm having problems on the results page, others are working correctly, the purpose is to print the approval or disapproval of the students in the table using foreach in PHP. Error:    Warning: Invalid argument supplied for foreach...
asked by 06.03.2015 / 19:13
1
answer

How to sort two vectors (ascending order) in a third vector using only one loop?

My teacher has posed this problem and I am not able to sort in ascending order just by using a loop to sort. #include<stdio.h> main(){ int i,a[5]={1,4,8,9,11},b[5]={3,6,7,10,15},c[10]; for(i=0;i<10;i++){ if(a[i]<...
asked by 14.04.2018 / 20:03
1
answer

pass an array of objects to another page

scoreBoard.push({ acertosOuErros: acertoOuErro, multiplicacao: resultado }); This is my array made in javascript, I wanted to pass this array of objects to another page so I would ha...
asked by 02.03.2015 / 18:53
1
answer

Error trying to add numbers to an array of int32

I'm trying to store an array of ints to use periostealmente, but I came across a syntax error in the part. { 4, 7, 8, 9, 10 } private Int32[] m_FluxosPlataformas = null; public Int32[] FluxosPlataformas { get...
asked by 16.02.2016 / 13:23
3
answers

Why is it not possible to assign a string vector after it has been declared, a character?

char vetor[10]; vetor = 10 /*ERROR*/ Why is this happening? Is it about vectors being composed?     
asked by 07.02.2018 / 15:01
3
answers

Sort a string array in Swift using a function

I need help to solve the following programming logic problem in Swift. The task is to organize the array below in descending order using a function. Description: You must implement an algorithm that receives a list of strings with specific...
asked by 04.05.2018 / 15:02
3
answers

Creating Array within Function

I'm trying to do an exercise where I have to create a array inside a function, and the same be accessed through an external code (example: ... php? pais = uk and show UK - London ). The array items are countries and capitals, eg...
asked by 27.07.2016 / 16:30
3
answers

Allocate memory in C for structure vector

What is the right way to allocate memory for an array vector? struct CARRO{ int id; char fabricante[MAX]; char modelo[MAX]; int ano; char cor[MAX]; int preco; }; int main(){ int qtd, i; scanf("%d", &qtd);...
asked by 27.06.2017 / 04:25