Questions tagged as 'array'

1
answer

Comparison of vectors in C

I'm currently trying to establish a comparison of two vectors in C. My code structure is as follows: int iguais(int *v1, int *v2, int tam) { int i, cont = 1; for(i=0; i<tam; i++) { while(*(v1 + i) == *(v2 + i)) {...
asked by 01.11.2016 / 10:01
1
answer

put elements of a table in a list

I have an empty table, and then a javascript code that allows you to populate the table via input. What I want is to put all the information in this table into an array (regardless of the number of rows and columns in the table) so that later yo...
asked by 11.11.2016 / 22:09
2
answers

Arrange multidimensional array in javascript, preventing the next item from having the same type as the previous one

I have a logic problem here. Let's see if you can help, because I'm burning neurons here and I have not found a starting point. I have an array of objects and I need to organize them in a way that the previous item can not be the same as the...
asked by 23.11.2016 / 03:56
1
answer

Word with reverse order

I'm doing an exercise where I have to do the given word with input exit in reverse order. I start by counting the number of letters that have the word entered (commented in the code). After having counted the number of letters in the word I...
asked by 22.12.2016 / 01:43
1
answer

"if and else" condition for sending Ajax, taking text from span tags?

It's kind of hard to explain by title, but it's the following, I have a foreach that prints in a <ul> tags list, and inside it I have the following code: <?php if ($row['Status'] == 'Em Processo'):?>...
asked by 31.08.2016 / 19:40
1
answer

Avoid using 'explicit' loop, find / edit array with desired value

I have the following array: $users = array( array( 'id' => 17, 'name' => 'Miguel' ), array( 'id' => 23, 'name' => 'Vera' ), array( 'id' => 39, 'name' => 'Sar...
asked by 29.07.2016 / 10:57
3
answers

Display the vector values in c ++

I can not list (display) products registered in my Vector. Anyone know how to steer me, I'm learning c ++. #include<iostream> using namespace std; int main() { int op, i=0; string produto[10]; double venda[10], custo[10];...
asked by 01.07.2016 / 07:05
1
answer

multidimensional array javascript

I have a following doubt. I will simplify as much as I can for you to understand. I am developing a game and I have an array with values. This array is multidimensional: var valores = [["jaguatirica", "onça-pintada", "suçuarana"],["sabia","can...
asked by 13.07.2016 / 16:06
1
answer

Store values in an inverted order vector

The goal is to read 10 values of a given vector, and then create another vector that has the same values as the first vector, but in inverted order, for example, the first value of the 1st vector is the tenth of the 2nd vector, the second value...
asked by 26.05.2016 / 20:43
1
answer

Do you have any way to access a position using a string?

Would not I have some way to access a position using a string ? Example: int vetor[1000000]; vetor["abc"]++; I know it's crazy, but ... "abc" = 01100001, 01100010, 01100011, 00000000 (null character), so "abc" should not represent 1633837...
asked by 07.08.2016 / 23:16