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
-
0
votes1
answer47
viewsDisplay in a Messagedialog the contents of List<String> message = new Arraylist<String>();
Good night, I need to display the contents of the message array in a Message Dialog: List<String> mensagem = new ArrayList<String>(); In the course of code I add some text to the array…
-
0
votes1
answer386
viewsOpen text file in float value list
I need to open some files I have here that are in txt format which is even less common and specific in data processing issues, these files consist of values from 0,000 up to 0,999 and also from…
-
0
votes1
answer155
viewsAdd arrays in PHP JSON file
Next, I need to make a json file with a stock of products and a page to add them to JSON. I got it with PHP through json_encode() add an array, but the problem: When I add an array, it n writes the…
-
0
votes1
answer51
viewsVector pointer with dynamic allocation in C
I managed to do this exercise inside main, however the same concept has not worked when using functions. The aim of the program is simple, read six values and display them. #include <stdio.h>…
-
0
votes2
answers255
views -
0
votes0
answers43
viewsHow to turn values from an array into PHP variables for BD query?
I am in dire need of any help from you with a little problem in PHP/Mysql. I have a variable that has the names of medicines separated by commas (string), the amount of names stored in this variable…
-
0
votes1
answer71
viewsHow to group array with the same ids in new array?
I’m using a php function to get custom Fields data from whmcs sql, but the operation returns the data in an array, separating each id by products. That is, it does not return the product with all…
-
0
votes2
answers67
viewsDynamic array in php for pg_insert()
I developed the following code as an example: $dados = "nome-luiz-idade-21-status-true";` $arraydados = explode("-", $dados);` I need to create a dynamic array, where: The even positions of…
-
0
votes1
answer76
viewsHow to check if there is an input of an array within another to avoid duplicating?
Good morning, that’s my first question around here I’m making an angled app using the google Books api and I need help.. I have a button that adds indices from the book array to the bookmark array,…
-
0
votes1
answer42
viewsPass multidimencional array by POST, and use it in PHP to export in CSV
It’s been a while since I’ve been banging my head to solve this problem. I need to pass a multidimensional array by POST to use it in PHP to export a CSV file. Let’s go to the codes! In the form I…
-
0
votes1
answer66
viewsPOST not receiving form input
In my code I have this form on HTML but in giving Ubmit in the form mine POST of PHP does not receive the image input. code HTML down below: <form action="/news/createsubmit" method="post"…
-
0
votes1
answer85
viewsdata mask with php
I am trying unsuccessfully to replace the values returned from a database field, which returns a ckeditor html code. I’m trying to do it this way: $class = new Selecionar();…
-
0
votes2
answers238
views -
0
votes1
answer52
viewsremove [] from the array list
i have a php file that generates a json in array for another application to read, however everything is working but the json is coming with the [] of the list, and my application can only read from…
-
0
votes1
answer346
viewsRemoving elements in common between 2 arrays
I have a fixed list that contains 20 items, and I have another list that comes from the bank. I need the items I have on my fixed list to be compared to what comes from the bank and, if there are…
-
0
votes1
answer171
viewsHow to return a specific element within an array?
I’m trying to return the largest among 4 numbers, for this I’m using the function qsort() available on <stdlib.h>. Follows the code: int comparison (const void *a, const void *b){ if (*(int*)a…
-
0
votes1
answer51
viewsTake multiple rows from a table in the database with the same name and display the name only once in a list
My form has the option to add more rows, so I had to use array and send its information to the database. In this case the database has created 3 rows within the table with various information, but…
-
0
votes1
answer42
viewsJava array changing itself
Trying to create a method to randomly swap 2 lines of a matrix [n][2], whenever I try to create this new matrix, it changes the previous one too, no matter what I do, that is, after I run these…
-
0
votes1
answer86
viewsdisplay multiple array by messagebox.Show on c# by clicking a button
people are creating a program to consult suppliers(being N suppliers), and I need that by clicking the button can see all registered suppliers and their information as this below : nomefornecedor1…
-
0
votes1
answer851
viewsScan array via javascript and remove duplicate objects with Map
I’m going through the following JSON: [ { "amount": 6, "codes": [ "BRCH", "ARSI", "ENSI" ] }, { "amount": 6, "codes": [ "BRCH", "ARSI", "ENSI" ] }, { "amount": 6, "codes": [ "BRCH", "ARSI", "ENSI" ]…
-
0
votes2
answers103
viewsPercorer 2 Distinct Arrays and Verify Which Values are Equal
How to go through 2 distinct arrays to verify which values are equal and after the check print only the equal values of both arrays? The arrays' structures are in the following form below, I tried…
-
0
votes1
answer28
viewsHow to access a vector within a PHP obejto and insert the data into the Mysql database
I would like to know how to access the array of addresses within this object: And insert the attributes inside a table in Mysql, I am doing it as follows foreach ($this->endereco as $elemento) {…
-
0
votes1
answer1875
viewsHelp on 2 Arrays questions
It has this function to find out how many months a person’s balance was positive: function quantidadeDeMesesComLucro(umPeriodo){ let quantidade = 0; for(let mes = 0; mes < umPeriodo.length;…
-
0
votes0
answers286
viewsDoubt in a code to calculate the growth of a tree
I am having some difficulties to make this code below work. The statement of the exercise is this: Utopian trees grow in a particular way in two cycles: Each spring doubles its size each summer grow…
-
0
votes1
answer64
viewsAdd data in Session array
I am using PHP to develop an application and I am using the following code to keep information in a session and return the data to generate an alert for the user: class Data{ const DATA = "DATA";…
-
0
votes1
answer205
viewsUse of For Cycle and Arrays
There are two exercises that I need to solve using a cycle (or loop) FOR... In one of them, I need to catch one array x as a parameter in a function, and multiply all its elements among themselves…
-
0
votes2
answers96
viewsArray with large numbers
This program stores 5 numbers in array and then displays them, but imagining that I want to save large numbers as: 8.12415367228151 / 119.038571952966 / 169.873349402464 / 324.997128488111 /…
-
0
votes1
answer57
viewsDoubt to return arrays on pointers. below is the code I tried, but only returns addresses
Good night, you guys. following, I would like a help to return a vector, whose goal is to implement a function that takes an integer vector V and returns another integer vector dynamically allocated…
-
0
votes1
answer509
viewsList of flutter images
In my flutter app I want to display images, and these images will be grouped by categories/albums. These images are brought in the form of an array, in this format: This is my current function to…
-
0
votes2
answers707
viewsGet maximum, average and minimum value on a JSON of an object array
I have the following JSON: { "funcionarios":[ { "id": 0, "nome": "Marcelo", "sobrenome": "Silva", "salario": 3200.00, "area": "SM" }, { "id": 1, "nome": "Washington", "sobrenome": "Ramos",…
-
0
votes0
answers37
viewsCompare a letter in a String array in java?
I’m doing an exercise in Java, on String, basically I have to enter a sentence with a maximum of 50 words separated by single space, after this check if all words start with the same letter, and the…
-
0
votes1
answer309
viewsTraverse array with Indice string
I am trying to traverse an array where the returned index is string (are names). I know how to walk when they come with 0,1,2,3... but with string I’m struggling. The return is as follows: Aatrox:…
-
0
votes1
answer153
viewsStore data from an array in a variable
I have a CSV file with the information as below: nome;cpf;ano;faculdade; Pedro Sampaio;45896588963;2010;fmu; Yuri Martins;45885485896;2012;uninove; Pablo Vittar;32585296363;2020;unip; I read this…
-
0
votes1
answer302
viewsPlacing items in an array with Reactjs
I’m trying to put items in a array by clicking the button, but the same one is starting empty. Notice that I clicked 3 times but it shows me that the array has 2 positions. I have a div which is the…
-
0
votes0
answers54
viewsAccess dynamically created array of items
I have a chronometer that adds images to each "X" seconds and each image is inserted in an array. I want every 4 images (array[3]) the timer to pause and issue an alert function addImg() { const…
-
0
votes1
answer679
viewsRemove "[ ]" brackets from json return
I have an api that returns me an array in JSON, as follows: [{"Pessoa_contato":"EUZEBIO"}] But I’m not getting back without these brackets, as my application needs: {"Pessoa_contato":"EUZEBIO"} This…
-
0
votes2
answers124
viewsHow to Calculate read values in an Array and store the calculation in a single PHP variable
The array has the following structure below: Array ( [0] => Array ( [value] => 0 [total] => 100 ) [1] => Array ( [value] => 1 [total] => 50 ) [2] => Array ( [value] => 0…
-
0
votes1
answer46
viewsMake a database query through an array
Hello, Guys, I got a big question here. I have a query where the user can select if they want to see all(Manager and Managers Jr), Only Managers Jr, or Directly select only one. All Only managers Jr…
-
0
votes1
answer620
viewsImplement queue (FIFO) using an array
I have a fixed size 20 list, I need the user to add registrations, however, when I click on "show" option, it presents me only the first element I added in all positions. For example, if you type…
-
0
votes2
answers359
viewsHow to intersperse the values of two rows in C, in a third row?
I am trying to intermediate the values of two rows in C, F1 and F2, in a third row, inter, as function below (n would be the amount of F1 and F2 elements): Fila *intercala_fila (Fila *f1, Fila *f2){…
-
0
votes1
answer27
viewsCheck login with arrays
Hello! I am trying to make a code that allows checking if a given email and password are within certain arrays, so far this code works, however I can’t make the code detect errors like: if the email…
-
0
votes0
answers19
viewsProblem with matrix boundaries
Good afternoon! I’m doing vector exercises and found a problem where I don’t understand. The proposed problem was to place values on a vector A and B of size 5, and then merge these values into a…
-
0
votes0
answers318
viewsFill a vector of size[10] with two other vectors[5] at positions 0, 2, 4, 6, 8 and 1, 3, 5, 7, 9
Question: Create two vectors with size 5 and a size 10 vector; Fill the two size 5 vectors with integers inserted keyboard; After filling the two vectors of 5 positions their content should be…
-
0
votes2
answers40
viewsHow to use "for" to work with data in an array whose amount of varied data is unknown?
I have the following JSON variable resulting from a php query: $json_string = '[ { "id": 1, "name": "Jogos para PC", "products": [ { "id": 34, "name": "Grand Theft Auto V" }, { "id": 59, "name":…
-
0
votes0
answers37
viewsFormarray does not print on my Reactive Form
I’m new to Angular and I’m having a really hard time getting a Formarray into my form. Summing up what I did was: Create 2 Formularies: the main (valForm) and another dynamically created…
-
0
votes1
answer37
viewsGroup two object arrays into porwershell
Hello, I have two arrays of objects, I have to group them. That is, go through the list (object array) of "car" and when there are properties in the property_list array added to that object, which…
-
0
votes2
answers148
viewsFunction that displays the characters of a repeating string
Example: In the string "programming" the characters 'a', 'o' and 'r' must be returned. I did so but did not return what is requested. #include <stdio.h> #include <stdlib.h> #define DIM…
-
0
votes0
answers19
viewsRegister Forms array in the database
I have a form that is dynamic, the user chooses how many input will appear. <div class="container"> <?php $g = $_GET['id']; ?> <form method="post" action="upload.php?id=<?php echo…
-
0
votes0
answers31
viewsCreate an array for Chartjs with Firestore + Angular 9 data
To popular a precise monthly/annual data chart that the Array is grouped by date. Data from the Firestore: this.chartsSrv.chartGeral().subscribe((snapshot) => { snapshot.docs.forEach(doc => {…
-
0
votes1
answer60
viewsHow to remove an array from occurrence found within a sub array!
Well, I have the following situation, I would need to check if the term exists (name of the fruits) if to delete the array that is matching the values (name of the fruit and code) Example: When…