Questions tagged as 'array'

2
answers

Join in array creating elements?

We can imagine the following array : var arr = ["a", "b", "c", "d"]; I know I can use join(", ") to make it into a string type: "a, b, c, d" , but I would like to create an element for each array item, which would be type...
asked by 26.07.2018 / 18:06
1
answer

Using pointer can make my code faster?

I was told that if I work using pointers the program will be faster. If instead of using index to traverse a vector I use the pointer, does it get better?     
asked by 30.07.2018 / 20:40
2
answers

OutOfMemoryError: Java heap space

I have the following code: class Main { public static void main(String[] args) { Lista chamar = new Lista(); String[] vetor = {"Palavra", "Letra"}; chamar.adicionar(vetor); } } class Lista { ArrayList<Str...
asked by 12.04.2014 / 19:09
2
answers

Dictionary for objects in Python

I would like to know how I can assign a dictionary to a set of objects. For example, I have a 4x4 vector of 'neuron' objects: [[<__main__.Neuronio object at 0x1035644e0>, <__main__.Neuronio object at 0x103564518>, <__main_...
asked by 01.06.2018 / 23:18
1
answer

Why does this retyped code not work the same as the original?

I'm studying C ++ a short time and I want to train rewriting functions already done by me in C # only in C ++. I wrote a simple code that calculates a IV of a hash, very simple even, calling the same methods using the same argument in...
asked by 21.12.2017 / 23:03
1
answer

How to set values of an array attribute?

I have a java class that represents a snack , below the class: public class Lanche { private String nome; private int id; private double preco; private String[] ingredientes; /*getters setters */ } Below is the test class i...
asked by 18.03.2018 / 18:48
1
answer

Print threaded list in C

I'm creating a program that receives a vector and creates a linked list. I need help to create the "print ()" function, which prints the generated threaded list. I do not know how to proceed. #include <stdio.h> #include <stdlib.h>...
asked by 03.09.2016 / 18:53
3
answers

Array position in Swift

I would like to know how to find the position of an Array in SWIFT Does anyone know? var nomes = ["Douglas", "Marilia", "Roberto", "Carol", "Lucas", "Iasmim", "João", "Zeca"] nomes.append("Franklyn") print(nomes) for constante in nomes{ p...
asked by 26.09.2017 / 16:38
2
answers

Reverse the positions

package pag1; import java.util.Arrays; import java.util.Scanner; public class ex3 { public static void main (String[] args){ Scanner x = new Scanner (System.in); int posicao = 0; int[] numeros = new int [5]; System...
asked by 04.07.2017 / 05:23
2
answers

Pass an array of objects via AJAX per POST and read the properties of objects in PHP

I'm having some problems solving this situation. I'm trying to pass my array of objects via AJAX to another page in PHP and read the properties that are inside each object within that array. For you to try to understand better I will post the co...
asked by 02.04.2017 / 02:07