Most voted "array" questions
An array (array, vector, or matrix) is an ordered data structure representing a collection of elements (values or variables), each identified by one or multiple indices.
Learn more…3,046 questions
Sort by count of
-
-1
votes1
answer379
viewsCannot access field on a value with type ARRAY
I’m trying to pull the spine name.pt_BR that is inside the column namebut I still don’t understand how to get it specifically in Bigquery. How to pull this info to give JOIN in another query later?…
-
-1
votes1
answer74
viewsHow to ask the user to create an np.array vector?
I would like to know HOW is it possible to write a program that reads an array numpy vector np.array([]) user-created. In lists, for example, we do: n = int(input("Determine o número elementos da…
-
-1
votes1
answer99
viewsHow to store arrays in vectors in C?
I need to create a vector that stores matrices and print these matrices. What would be the correct way to do the assignment and print the matrices through the vet? int main() { int *vet; int **mat;…
-
-1
votes1
answer49
viewsI can’t access an index from an array
Well, I am having trouble accessing the 3° index of my list. When I try to access, returns me an error of: List index out of range. vertices = [[-1,-1,1], [-1,1,1], [1,1,1], [1,-1,1]] for v in…
-
-1
votes1
answer12
viewsFill a vector using useDelimiter in Java
Hello, I’m wanting to fill a vector using the useDelimiter of Java. For now I only know how to fill a vector this way using for: for (int i = 0; i < vet.length; i++) { System.out.print("Digite um…
-
-1
votes1
answer35
viewsHow do I print an array in the form of rows and columns?
#include<stdio.h> #include<stdlib.h> int main(){ int m[3][2]; for(int i=0; i<3; i++){ for(int j=0; j<2; j++){ printf("Digite o elemento na linha e coluna [%d],[%d]: ", i, j);…
-
-1
votes1
answer59
viewsI wonder why my code doesn’t work, I believe my logic is correct, but it’s picking up garbage
I will receive 5 values in the vector, I have to add the largest of them to the smallest of them, What’s wrong with it? follows my code. #include <stdio.h> int main(){ int vetor[5]; int i = 0;…
-
-1
votes0
answers21
viewsHow to turn an array into a phone number
I’m in doubt how to write this function. could help me? write a function that accepts an array of integers (from 0 to 9), which returns a string of these numbers in the format of a telephone ("(XX)…
-
-1
votes1
answer57
viewsResult 0.0 - even with Typecast or changing variable types
I have this method in the secondary class to calculate the median of a vector: public class Funcoes { .... public void setMediana(int[] valores) { double med; Arrays.sort(valores); int meio =…
-
-1
votes1
answer48
viewsCount items with a certain extension within a PHP array
Hello, good morning! All right? I need to set up a media gallery for a certain image extension ('.jpg') and I’m having difficulty counting the files ($key) in the value field (ds_midia_link). How…
-
-1
votes1
answer975
viewsDelphi _How to pass data to a record array type property
unit Exemplo; interface uses Classes, SysUtils, typinfo; const type {TRecordRateio} TRecordRateio = Record IdContaCorrente : Integer; CodBanco : String; Agencia : String; DVAgencia : String;…
-
-1
votes1
answer852
viewsRemove empty spaces in JS arrays
I would like to know how to eliminate the gaps that are in a vector. The situation is as follows: I need to read all the text tags of an HTML page and store them in an array so that I can work them…
-
-1
votes2
answers376
viewsQuery does not return fetch_array
I’m trying to make a query however, although the query works well in Phpmyadmin in the browser returns the message below: Fatal error : Call to Undefined method Pdostatement::fetch_array() in D:…
-
-1
votes1
answer56
viewsIn the vector category pair<string, int>: When adding a new string, check whether a future string has the same value as an already added string
And if so, change the value of the previously added pair instead of adding a new pair. So, I’d like to add string pairs, int into an array, only, to avoid redundant pairs, check if the string…
-
-1
votes1
answer961
viewsURI Online Judge - 2163 - Python 3
I’m having trouble solving the problem The Awakening of the Force of the URI. A long time ago, in a galaxy far, far away... After the decline of the Empire, scrappers are scattered throughout the…
-
-1
votes1
answer106
viewsLevel PHP Array
I need to put this array all on the same level, I tried that way, but I couldn’t leave everyone on the same level, it goes down the input, output and the code I tried. Entree [ (int) 0 => [ 'id'…
-
-1
votes1
answer127
viewsMove the highest value of an Array to the end of it.
I need to create a method that takes the highest value of an Array and passes it to the end of that Array, so that the array is ordered, without losing any value. I tried several ways and I still…
-
-1
votes1
answer343
viewsDictionary for objects in Python
I wonder 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…
-
-1
votes1
answer210
viewsHow to verify that vector fields are null?
I am building a program, which should initially check whether the array of type (Class) is null. My class has the get and set method, as well as the constructors with and without standard. However,…
-
-1
votes2
answers71
viewsI can’t seem to register a person’s name in my calendar
I’m making a very simple schedule, the numbers I managed to castrate but the names of the people I couldn’t get. My code #include <stdio.h> #include <malloc.h> #define MAX 50 typedef…
-
-1
votes2
answers216
viewsUse array type variable that returns the ajax function in PHP?
I have to pick up a variable type array of ajax and is returning correctly to the console.log(date); but I’m not sure how to use the return variable inside the index.php file. Index.php…
-
-1
votes2
answers59
viewsConvert arrays to hash
I am giving some maintenance on a system in Perl (language that I am Noob) and I needed to create a new report module where I need to solve the following situation: I have 2 arrays with the…
-
-1
votes2
answers184
viewsReturn JSON php TRUE or FALSE
Good morning, I would like my JSON filtering to also search if what I searched indicates that it is "true" or "false. I use this array to search the file: <?php session_start();…
-
-1
votes2
answers412
viewsJavascript: How to pick up an array of objects within a child of an array of objects
I have the following example object: const empresa = { nome: 'Tal tal', endereco: 'taltaltal', groupos: [ { nome: 'taltaltal', codenome: 'tal', as: [ { nome: 'grupo a', apelido: 'ga' }, { nome:…
-
-1
votes1
answer112
viewsHow to deal with the null values of an array when converting from String to Double?
I need to display the top 10 contract termination clauses, which are in a vector, extracted from a CSV file. Here, when I refer to contract termination clauses, I mean monetary values (money), more…
-
-1
votes1
answer54
viewsWhy is my array not sorted? (Bubble Sort)
I fed the array with the user input, but the algorithm doesn’t give the output in an orderly way, which I did wrong? int main() { // variáveis int vetor[5] = {0}; int aux, i=0, j=0; printf("Entre…
-
-1
votes1
answer23
viewsToogle Select function
I have the following scenario: I have a list of addresses that comes dynamically from the bank, according to what is registered by the user. I need to enable only one address, so when a button is…
-
-1
votes2
answers91
viewsWhen inserting into a vector always overrides the previously inserted value
In my code when adding a contact (X), and see the contact list, I have contact X, however when adding another contact (Y), and go see the list, the contact Y replaces the X, how can I add several in…
-
-1
votes1
answer70
viewsdoubt in array
My program needs to receive two vectors, A and B. This defines the set To Pikachu B as the set formed by the elements that appear in A or B. In addition, it has the set To Chikorite B as the set…
-
-1
votes1
answer75
viewsSomeone experienced who understands string manipulation well, who can help with this error
Good morning, I am presenting a problem that I have no idea the reason, I have tried to ask other people, none discovered the real reason for the error and how to repair it. Good my teacher, asked…
-
-1
votes2
answers221
viewsVector ordering problem in C
I’m trying to make this problem, but always the result goes wrong. "Make a program that creates a user-filled 10-position array. Scan the vector and whenever the value of position i of the vector is…
-
-1
votes1
answer651
viewsSort Array by data time in php
Hello, I have already looked into the matter but I have not yet obtained anything that works properly. I have a database with multiple orders and these have a deadline and also a fixed date, but the…
-
-1
votes1
answer137
viewsPHP - Sort object by date without key
I am receiving from an API the following object: { "30/01/2019": [ { "type": "document", "filepath": "url", "recipients": [ "Todos" ], "category": "Ata", "date": "30/01/2019" }, { "type": "note",…
-
-1
votes1
answer31
viewsERROR Array to string Conversion on line 28
I was watching a tutorial and the video of the instructor that was posted did not give this error, and now it is with me: Array to string Conversion on line 28 I already looked for a solution and…
-
-1
votes1
answer370
viewsDisplay data from an array of objects stored in memory
I cannot make a method that returns the information of registered students. package menu; import java.util.Scanner; import modelo.Aluno; import repositorio.RepositorioAluno; public class AlunoMain {…
-
-1
votes1
answer702
viewsHow to resolve "Array to string Conversion" Laravel Error
I am trying to update a registration form modal. The following error is occurring: Array to string Conversion (SQL: update checklist_protocolo set item = 0, item_descricao_id = 5, sim_nao = on,…
-
-1
votes1
answer148
viewsHow to read a certain line of multiple files in Java
In the Stock folder, I have several.txt files. I would like to read each row of these files. The question is: how? NOTE: if I could save the name of each file, I might be able to solve the problem.…
-
-1
votes1
answer115
viewsComparison of object attributes within a for loop
How to compare a single item of an object that has 3 spaces or more? I want to make a system that, every time the login is equal to some that is already stored in some object, appears an alert…
-
-1
votes2
answers92
viewsPassing a vector to a function in C
In my C practices, I decided to practice using a vector through a function, using the method of passing by parameter. The goal of the program is to receive the 5 elements of a vector, then show the…
-
-1
votes1
answer1570
viewsRandom numbers within a vector in C
Hello would like to know what would be the ideal method to generate random numbers within a vector in C using the function Rand(), I get an error when I try to run the code below. follows the code:…
-
-1
votes1
answer212
viewsGroup values from a multidimensional array with the same value and display in a table
Good morning, I have a multidimensional array, shown below: array(3) { [0]=> array(1) { [0]=> object(stdClass)#35 (3) { ["id"]=> string(2) "73" ["valor"]=> string(6) "200.00"…
-
-1
votes1
answer35
viewsMultidimensional array how to remove a character from a given index?
The code below is the result of reading a CSV file, which transforms it into Array to treat it to create a new CSV to be imported with a new format. I want to remove the - that are in the phone…
-
-1
votes1
answer84
viewsGrouping Lines from an Array - PHP
I have an SQL query that returns a set of values: cod_Vd nome_Vend cod_eqp nome_equipe 46 46 - EVANDRO 1 EQUIPE -01 87 87 - ALAN 1 EQUIPE -01 44 44 - ANA 2 EQUIPE - 02 84 84 - JORGEVAL 2 EQUIPE - 02…
-
-1
votes1
answer787
viewsRECURSION IN C - COUNT EVEN NUMBERS OF A VECTOR
#include <stdio.h> #define N 6 int verificaPar (int v[], int n, int qtd, int indice); // protótipo int main() { int vetor[N] = {13, 6, 8, 3, 4, 9}; // vetor igual do exercicio int resultado ;…
-
-1
votes1
answer247
viewsHow to find nearest value in an array?
var dados=[0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 4.75, 5.0, 5.7, 6.0, 6.2, 6.5, 7.0, 7.1, 7.5, 8.0]; var DadoMaisPertoDe = 3.8; //preciso encontrar o valor 4.0 //outra demanda //dado o valor encontrado…
-
-1
votes2
answers837
viewsAdd an array inside another already created Javascript
I can create an array within another as follows: var meuArray = [["1","2","3"],["4","5","6"]]; With this I can easily check the positions just by calling meuArray[x][y], where x is which array I…
-
-1
votes1
answer400
viewsLaravel: Take the value of an array without foreach
I have the following appointment: $TenantId = DB::select('select tenant_id from users where id = :id', ['id' => '7']); dd($TenantId); The result of $Tenantid is: array:1 [▼ 0 => {#357 ▼…
-
-1
votes1
answer275
viewsError in exchange for elements in the matrix
I’m trying to exchange two position elements in this matrix. After some changes, the elements begin to exchange among themselves in an apparently random pattern. Could someone identify me the…
-
-1
votes1
answer136
viewsHow to make a program in java that tells you which positions are ahead and behind a word
This method tells how many words you have in a sentence: public static int pesquisaPalavra(String palavra) { String frase = "Deus é bom o tempo todo, o tempo todo Deus é bom"; String[] arrayString =…
-
-1
votes2
answers1504
viewsObject array in JAVA
You guys talk beauty ? So, I’m a beginner in java development and my first cruel question that I faced in a question in the course was the following. "Register data from a current account or savings…