Questions tagged as 'array'

1
answer

Array of objects in php, objects being overwritten, why?

I've created a helper to organize the menus returned from the database so that it looks similar to a return of a native method of the framework I'm using. The code snippet that contains the error is this: $obj = new \stdClass; $menu = array()...
asked by 11.04.2018 / 22:22
1
answer

Compare a vector of char?

Good people I have the following doubt why I can not compare two vectors of type char using relational operators? I know that vectors are a compound type and that the characters are in a static area am I right? But what influences at the time...
asked by 21.04.2018 / 21:10
1
answer

Create array and count values

I'm having a hard time drawing a array in PHP with the following data coming from a JSON object, no, it does not come from a SQL query in a database. Example of JSON : [ { "data": { "ID": "349", "use...
asked by 26.03.2018 / 15:54
1
answer

Invalid argument supplied for foreach () - Array

Good morning. I'm trying to consume a json in PHP but I'm having this problem:    Warning: Invalid argument supplied for foreach () in   D: \ xampp \ htdocs \ api \ consume \ index.php on line 7 Array code - JSON link PHP code...
asked by 24.04.2018 / 13:33
2
answers

Join 2 arrays

I have two arrays $pessoas = 1 => "ERICA GRELLERT" 2 => "IARA BEATRIZ" 3 => "DANIELLE" 4 => "MARIANA" 5 => "ALESSANDRA" 6 => "EDUARDO" 7 => "DIEGO" 8 => "ROBERTA" 9 => "THIAGO" 10...
asked by 24.04.2018 / 19:18
2
answers

How do I access a list within a list in VueJs?

I'm having difficulty listing the values of a Json, but the result of it is an array inside an array as you can see below; { "status": true, "valores": { "USD": { "nome": "D\u00f3lar", "valor": 3.2789,...
asked by 19.03.2018 / 10:49
1
answer

Calculation of Factorial in Ruby

Create a Ruby script that reads 10 integers and stores them in an array. Then, the script must calculate the factorial of each of these 10 numbers, and store the results in another array, and print the values. I can not hit the factorial and...
asked by 13.05.2018 / 00:38
1
answer

How to convert a JSONArray to an array of strings?

String mensao = "[\"brega_falcao\",\"SamiPietikainen\",\"TecRahul\",\"gpantuza\",\"mkyong\",\"mkyong\",\"YouTube\"]"; Mensao is the JSONArray that I want to convert. I tried this but it did not work: //Retiro o '[' do inicio e do fim ']'...
asked by 17.04.2018 / 17:40
1
answer

Allocate space for a vector vector of double

I'm trying to allocate space in memory for a vector of vector of double. I know that for a vector vector I can do vector<vector<double>> Vetor(51, vector<double>(47, 1)) And this generates a vector [51] [47] but in the ca...
asked by 07.03.2018 / 14:30
1
answer

I am doing a simple program to study Vectors, when I run it appears the error "Index was outside the bounds of the array" in line 24

using System; public class Program { public static void Main() { int i, n; Console.WriteLine("Entre com o número de Alunos: "); n = Convert.ToInt32(Console.ReadLine()); String[] nome = new String [n];...
asked by 11.03.2018 / 16:36