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
answer42
viewsHow to insert a new associated key within PHP Multidimensional Array
The array has the following structure below: $array = [ [['total_arrematado' => 27, 'id' => 5],['total_arrematado' => 10, 'id' => 7]], [['total_arrematado' => 50, 'id' =>…
-
-1
votes1
answer89
viewsBuffer Overflow
Good afternoon, folks, I’d like to request a hand on the college ATV; About this code used as an example: #include <stdio.h> #include <string.h> int main() { char…
-
-1
votes2
answers45
viewsCheck empty PHP array
I made a push array, however, has an attribute that I should put only when it has some value or greater than zero. Normally the table takes the value it has, but it cannot be zeroed. If it is zeroed…
-
-1
votes1
answer80
viewsShow all possibilities of Python numbers
How do I show all possibilities according to the number of bit quantization, for example: user: 8 levels bits: 3 need to show then: 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 my code so far,…
-
-1
votes1
answer45
views -
-1
votes1
answer114
views -
-1
votes1
answer141
viewsHow to create a variable-sized array in Java?
I am trying to perform an exercise in Java that creates an A vector and adds even and odd values in 2 vectors, B and C, respectively. However, I am required to declare the size of these vectors…
-
-1
votes1
answer144
viewsAsk the user to enter 10 names and then show them reversed in Javascript
Good evening! I’m trying to resolve this issue, but I’m getting nowhere. Would you please help me? 1} Ask the user to enter 10 names. Display all the names typed on the screen, but in reverse (from…
-
-1
votes1
answer21
viewsPass array to modal with JQUERY
Talk personal, all right? I have a little problem here that is taking my sleep. rs I can pass variables to the modal quietly as in the example below: Button that switches the variable to the modal:…
-
-1
votes1
answer47
viewsView data from fetch array in modal - PHP
I’m making a task application with database, in which data is stored in a mysqli_fetch_array and listed in a loop while. When I click on a expand button, which has in the task structure (code…
-
-1
votes1
answer55
viewsHow to create a multidimensional array in c++?
I have a matrix float m2D[4][4]. For the purposes of my program, I need at the same time to change the values in the components of m2D be able to save the status prior to that change. It’s basically…
-
-1
votes1
answer60
views -
-1
votes1
answer38
viewshow it returns an array of a function
I want to take data from a SELECT array public function aluno($cod) { $cod = ""; global $pdo; $sql = $pdo->prepare("SELECT KS0042.CODALUNO, ks0300.ALUNO From KS0042 Inner Join KS0300 ON…
-
-1
votes1
answer17
viewsTake the size of the firestore array to use in Listview.Builder itemcount
return Scaffold( body: StreamBuilder( stream: stream, builder: (context, snapshot) { if (snapshot.hasData) { return ListView.builder( itemCount: snapshot.data.docs.length, itemBuilder: (context,…
-
-1
votes1
answer64
viewsHow to invert a vector in C?
I created a function to reverse vectors however when I run the program I do not see anything. This is my code for now: #include<stdio.h> #define DIMV 30 int lerIntPositivo(){ int numero; do{…
-
-1
votes1
answer67
viewsCreating condition inside the javascript map function
I have two problems related to the map/filter function. I’m taking data from a google data tructure and they follow the schema.org, however, in my case, a specific information is not always in the…
-
-1
votes1
answer35
viewsFunction inside map returning Undefined
I have a map function that needs to confirm if certain values exist so that certain gaps can be filled. The function that tests if the values exist was created but when returning the value inside…
-
-1
votes1
answer41
viewsSubtraction between elements in Ruby array
Hello, I have an array of values: values = [3, 5, 12, 1, 2] I would like in the first iteration all elements of the array to be subtracted by the first element (Ex, 5-3, 12-3, 1-3, 2-3) # [2, 9, -2,…
-
-1
votes1
answer42
viewsDestroy array in C++
Speak devs, I’m trying to destroy the Wheel array but I get an error message: error: expected Primary-Expression before ';' token How can I fix the error? Follow my files if you can take a look:…
-
-1
votes1
answer26
viewsRender radio Buttons based on arrays
I am developing an online school evaluation. I get some questions and each question has several options for selection. Need to show options like Radio Buttons, allowing user to select 1 option by…
-
-1
votes2
answers43
viewsSelect a specific JSON array with Javascript
I created a script with Axios to resume a call, then the result: [ { FieldId: 8095, FieldName: 'Nome1', FieldValueIds: [ 12059 ], FieldValues: [ '9.000' ], IsFilter: true, FieldGroupId: 99,…
-
-1
votes2
answers115
viewsJoin two arrays if field is equal in both
I have two arrays: Exam: [ { "id": 1, "title": "Avaliação - Procedimento em Serras", "description": "Uma pequena descrição sobre a avaliação." }, { "id": 3, "title": "Avaliação de Recuperação -…
-
-1
votes1
answer45
viewsTraversing matrix and summing the values
Hello guys I was doing a challenge of Hackerrank, and I came across a challenge where I asked to make the sum of the diagonals from right to left, and from left to right and finally returns the…
-
-1
votes1
answer158
viewsIndefinite array key
Community greetings, I’m starting in php and came across a problem that I believe is about variable scope. The project is to show the prime divisors of a number (saved in the "divisors" array) and…
-
-1
votes1
answer40
viewsCreate a PHP array from a variable and organize decreasingly
Good afternoon, I’m doing a school project, and I need to display the machines and the number of problems they gave, I would like to show you in a decreasing way. But after taking a look, I thought…
-
-1
votes2
answers51
viewsProduct between vectors
The user chooses the number of positions of two vectors and makes the product between them and displays in the list the result, the code I made is below v1 = int(input("Digite a quantidade de…
-
-1
votes3
answers91
viewsMake a program that receives 5 numbers and show the following output:. C++
I’m having difficulty formatting the output code is working right, someone has idea how to fix the output #include <iostream> #include <cstdlib> #include <clocale> using namespace…
-
-1
votes1
answer42
viewsHow to fill null spaces in a java array?
I need to store a person’s first and last name within a variable. I was able to separate String words within an array and take the first name (by index 0) - and now I would like to know how to get…
-
-1
votes1
answer29
viewsProblems with assigning values from one vector to another, using malloc
I’m trying to make a program that reads a certain amount of values and inserts it into a vector that uses memory allocation. After that I created two more vectors (in the same way as the previous…
-
-1
votes1
answer31
viewsHow do I change the position of two names in the table using up and down buttons?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Exemplo de…
-
-1
votes1
answer19
viewsArraylist of another class does not print elements
I have a main class and another class, basically I have to read a CSV file in which the first line will have the materials of a student (matematica, portugues etc). The number of materials is N can…
-
-1
votes1
answer49
viewsDoubt in Try-catch & vector JAVA
I have the following question: 2. Declare a vector of four positions of the whole data type, the software must remain asking the user to enter a value, until it enters four valid values, the valid…
-
-1
votes1
answer263
viewsRead a txt file, insert into an array and display in a textbox in C#
I need to open the txt file with the data already inserted with three columns and separated by ';' and after opening the file I insert it into an Array with List, save the data and need the values…
-
-1
votes2
answers53
viewsArray in C - How to print values from an Array
How can I take this information from the keyboard, name and value of three products, and print in table form the name with its value beside? I did so (code at the end), but at the moment appears the…
-
-1
votes1
answer73
viewsList Comprehension returning zero
Guys, I need your help. I have a code in python that I would like to return the amount of values that meet a criterion, but it is returning zero. The txt file contains data like this:…
-
-1
votes1
answer28
viewsJS - How to loop based on data from an array?
Good, I have the following JS array in my code: var Boletins = { id:1, items: [ { "#": "1", "Data": "19 a 25 de Março de 2021", "Região": "região de Trás-Os-Montes e Alto Douro", "Niveis": "muito…
-
-1
votes2
answers57
viewsSearch PHP array value
How can I search for the key value of "item_a" and return all the key values of "valor_a" in the array below? Example: I want to search by item_a = 3 and return the values 396, 1514 and 2106. array…
-
-1
votes1
answer32
viewsHow to Scrap a Table and insert the data into the database?
Well, basically what I need is to do a microservice that extracts the prices from the soybean quotation from this table: https://www.canalrural.com.br/cotacao/soja/. And then insert the data into a…
-
-1
votes1
answer41
viewsHow to assign positions to an array within a "while" loop?
Hello! I am very beginner in programming and am doing an exercise to create a program that converts decimal numbers -from 0 to 255 -, which the user types, to binaries. I can already convert…
-
-1
votes1
answer49
viewsDatalist with array
with little knowledge and search I managed to reach this code where I seek to create a DATALIST that when selecting an option of name... Complete the other two fields RG and tel in input…
-
-1
votes2
answers44
viewsStore words in a "char" vector
I’m trying to make an algorithm that returns the region of the CPF that was informed, but I’m bumping into the character limit that a variable of the type char allows in C language. I tried to…
-
-1
votes1
answer30
viewsVector C++ printing garbage
Save it guys. I’m building a C++ cache simulator for a college job. While I was building and testing the code, I came across this mistake. The idea was for the user to set the number of addresses of…
-
-1
votes0
answers15
viewsMount a string with user-delimited size and can be parsed character by character
I need to keep several names (compounds) of different people, so that I can return to the user the first letters of each name, and the last name of each person. That’s what I’ve done so far:…
-
-1
votes1
answer22
viewsLaravel - json_encode() does not work
Bring to Laravel in array format. [compacto] =>…
-
-1
votes0
answers13
viewsConditional rendering in a single map Component
to with a little problem here, to fzd a map of some data and wanted to put a conditional rendering on each, when the delete or Edit button was pressed, but when I click on the button of a map item…
-
-2
votes2
answers3773
viewsGroup and add array in Javascript
How to do a function to sum only values that are of the same date? I passing an array of arrays: [{ servicos: 0, remessa: 503, materiais: 0 , retorno: 598, entrada: 0, date: new Date("2011/12/20")…
-
-2
votes1
answer174
viewsHow to build a simple APNS server with PHP?
I am creating a small service triggering notifications. I made this code, to make several pushes shots, where the devicetokens come from a server. But I’m finding the following problems: When I…
-
-2
votes2
answers142
viewsError reading position (3) of Two-dimensional array: Invalid argument supplied for foreach
How can I read the contents of array $detail[3] after using the explode(implode) ? I’m doing it this way: $aArray = array( "Titulo" => array( "Class|SubTitulo" => Array( "Detalhe01",…
-
-2
votes1
answer43
viewsFunction that makes the direct $foo[array_rand($foo)]
There is a native PHP function that does this without using array_rand in the array key? Although it is working well and is a simple stretch, it follows a simplified example of doubt: //Declarando…
-
-2
votes1
answer329
viewsJavascript multidimensional array with angular is undefined
I’m trying to create a multidimensional array but it returns to me results[array. state] is Undefined. I’m using angularjs: results = new Array(); var indice = 0;…