Questions tagged as 'array'

1
answer

Relate 2 objects to a single reference / key

I have a while(true) that accepts multiple connections ( Socket and ServerSocket ). Each connection is passed to a Handling object that handles its read / write data. This Handling is passed to a Thread so you can accept connections and...
asked by 13.08.2015 / 18:11
3
answers

Merge array as PHP

I have this: $categoria_1[0] = array( 'code' => 'ALI000001', 'name' => 'Alimento > Arroz ); $categoria_2[0] = array( 'code' => 'ALI000002', 'name' => 'Alimento > Massas ); You have to leave it like this:...
asked by 08.04.2017 / 17:52
2
answers

Nested Vector Logic - C ++

I have a problem with the following statement: Given a vector A with n real numbers, get another vector B, also with n real numbers, as follows: B [1] = 2 * A [1] B [2] = 3 * A [1] + 2 * A [2] B [3] = 4 * A [1] + 3 * A [2] + 2 * A [3...
asked by 06.09.2015 / 16:35
1
answer

Non-static variable can not be referenced from non-static context

I'm using a context where I have a variable of type array with reference to another class. When trying to declare the object-instantiated class and declare its size this error is returned and I would like to understand why:    non-static vari...
asked by 09.09.2014 / 03:19
2
answers

Cipher of vigenere

private static void algoritmo(String input, String chave, Boolean b) { Console.WriteLine("Digite a mensagem: "); input = Console.ReadLine(); Console.WriteLine("Digite a chave: "); chave = Console.ReadLine();...
asked by 19.02.2017 / 01:35
1
answer

Delete information from a vector that is in another C ++ class

Hello, I have a question regarding classes in C ++, I hope someone can help me. Thanks in advance! I'm developing a college assignment where I need to enroll students, subjects, and grades, and in the end display some reports, all using the c...
asked by 29.06.2015 / 04:04
3
answers

Working with array with X layers in JS

I have a big problem, I already researched in several places and I did not find the solution I hope you can help me ... My goal is to create a function in JS that will get an array as a base, which I will call here as " A " its structure is this...
asked by 01.07.2015 / 21:25
1
answer

Search Index of the array from the json value using indexOf

I have the following array: var usuarios = [ {nome: "João", id: 1}, {nome: "Maria", id: 2}, {nome: "José", id: 3}, {nome: "Ana", id: 4}, ]; I need to return the user index José. I tried using indexOf as follows: var...
asked by 16.06.2016 / 02:12
1
answer

struct array of characters

I'm having to remember programming in c ++ to teach a beginner class in programming logic. Subject this I have not seen for years. A struct was declared however when entering a string, the stream jumps to the next line. I looked for re...
asked by 26.10.2018 / 22:53
3
answers

How to sort vector in descending order?

How do I place a vector in descending order? public static void vetor() { int[] vet = { 7, 4, 10, 8, 2, 5 }; Arrays.sort(vet); //Comando para colocar em or...
asked by 22.06.2017 / 00:15