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
answer111
viewsHow can I print this array in table form
$tabela = array( array("Atlético", "Goianiense", "Goiânia", "GO", "0 (não possui)"), array("Atlético Mineiro", "Belo Horizonte", "MG", "1 (1971)"), array("Atlético Paranaense", "Curitiba", "PR", "1…
-
0
votes1
answer191
viewspassword confirmation in c
I need to register N people in my program with only two information: name and password. Then the user enters a name, if this name is not registered the program displays a message of no registration…
-
0
votes2
answers100
viewsClick detection and value collection
I am developing a basic calculator to learn a little more javascript, however, I soon came to doubt. How do I go through all the li’s and get their values individually within the array, how do I…
-
0
votes1
answer85
viewsPush array only works inside callback
I am trying to update an array with values returned by Mongoose. But the array returns empty. It follows the code snippet: let y = []; Vendas.countDocuments( { dt_encerramento: { $gte: jan, $lte:…
-
0
votes1
answer589
viewsAlphabetical sorting in Array with objects in PHP array
I have the following array in php: Array( [0] => Array([id] => 1 [nome] => b parceiro um [status] => true [descricao] => <p>Descrição do parceiro</p>) [1] => Array([id]…
-
0
votes1
answer82
views -
0
votes0
answers37
viewsHow to get the contents of my Keys ascending order array
I’m having a problem with a function of an app I’m creating. I am a mere beginner in programming seeking to improve my knowledge and wanted to know how to make my function take the contents of the…
-
0
votes2
answers55
viewsHow do I set the state with local dynamic json?
How do I place json data within the "recipes[]" array that is in the state? import recipes from '../receitas/recipes.json' constructor(props) { super(props); this.recipes = recipes.results; //json…
-
0
votes2
answers191
viewsdifference between vet[] and *vet
When I send a vector to the function, in the arguments.. what’s the difference between putting void funcao(int vet[]) and void funcao(int *vet)…
-
0
votes2
answers16529
viewsCannot set Property 'innerHTML' of null
I tested the code below and returned me the error: p1-rad1-RE_UP.html:35 Uncaught TypeError: Cannot set property 'innerHTML' of null at Object.listarTodos (p1-rad1-RE_UP.html:35) at…
-
0
votes1
answer646
viewsHow to increase the size of a vector while maintaining its original shape? MATLAB
I have two vectors, one has vector X of 729 elements and the other vector Y 429 elements, but I needed to assemble a graph (vector X, vector Y), however they have different sizes and this is not…
-
0
votes1
answer40
viewsI can’t get him to print everything together as a vector, it’s all separate
P1-2017-RAD I <table> <tr> <th>Veculos</th> </tr> <tbody id="veiculos"> </tbody> </table> </body> <script> var cadastro = new function(){…
-
0
votes0
answers93
viewsHow to change the order of values within a PHP array?
I have the following array: $arraymaterias=array('his;51','mat;60','mat;60','mat;60','mat;60','mat;32','por;60','por;60','por;60','por;60','por;60','por;60','por;60','por;37'); I wanted her to…
-
0
votes2
answers50
viewsRedeem values from an array when the value is greater than x
I have an array that says, which seller and how many sales he made: array{ 'a'=> 1 'b'=> 2 'c'=> 16 'd'=> 4 .. } I need to know how many sellers have sold more than 4 products.…
-
0
votes1
answer623
viewsAdd values from an array
I’m trying to make this code, which is basically a six-by-six two-dimensional array with the distance between six cities, then collect the route that the user did in a simple array [6], and…
-
0
votes1
answer51
viewsProblems when creating lists
I am trying to get the program to create a list with the name of the files found in the directory and within each entry of this list, create a list of strings with the contents found inside the…
-
0
votes2
answers587
viewsHow do I check that my file type input is empty in PHP?
<form action="teste1.php" method="post" enctype="multipart/form-data"> <input type="text" name="title"> <input type="file" name="arquivos[]" multiple> <?php…
-
0
votes1
answer206
viewsTaking ids from an HTML and playing for a Javascript array
I have a very large form in HTML and would like to take the ids and store them in a Javascript array, and then access them by applying the rules (empty name type; invalid.) HTML <form…
-
0
votes2
answers37
viewsProblems when performing INSERT (PDO)
Good afternoon! I’m encountering problems to perform the following insert: function cadastro($usuario,$senha,$status){ $pdo = con(); $usuario = "Matheus"; $senha = "123"; $status = 3; $inf = […
-
0
votes2
answers189
viewsHow to test if a string is a number in the C language?
I’m a beginner in programming. I am performing an exercise in which I must determine whether a character string is a number, considering that the user can write anything as input. So I created the…
-
0
votes1
answer27
viewssearch object from within an array by value of an attribute
I have two arrays, an array has the following format: todasAsCartas:[ { id: 1, 'valor': 2, 'naipe': 'Paus' }, { id: 2, 'valor': 2, 'naipe': 'Copas' }, { id: 3, 'valor': 3, 'naipe': 'Espadas' }, {…
-
0
votes2
answers1403
views -
0
votes1
answer59
viewsI’m having trouble printing a variable in my program
I’m doing a program that simulates a bank, in function criarpessoafisica I’m trying to get the algorithm to check that Cpf is already registered, but it’s not working ! For some reason he printed…
-
0
votes1
answer523
viewsHow do I write data from an Arraylist to a txt file (in addition to reading the file when starting the program)?
Full Project Github Repository /*a human resources company specialising in market relocations (job vacancies), calls for the creation of a system to computerize its actions. Thus, she wants to…
-
0
votes1
answer112
viewsHow to transform a string into an array
Good guys, next how can I turn a string into an array? For example: String test = "345,421,888,211"; Explaining the context, these values are Id’s that I concatenated into a string from a grid.…
-
0
votes1
answer52
viewsGenerate a new array dynamically with php
How could I generate a new array in a loop? for example make the machine generate array1[], array2[] I can create a variable like this with the following code: ${'var'.$i} // E isso virar $var1,…
-
0
votes1
answer49
viewsAdding values for equal properties to an object
I would like to know how to add values to a "property", when an array displays different values for the second "property" and the same value for the first "property". For example: Entree: array1: {…
-
0
votes1
answer95
viewsHow to mount an array dynamically
I’d like to make a func that returns me the following array, however I don’t know the return type or how to dynamically assemble this array: vDataSource_Detalhe = NSArray(objects: NSArray(objects:…
-
0
votes0
answers73
viewsString inversion C language
I have to do a show and almost finished the same. Here’s what you ask for: Palindrome is a phrase or word that keeps the same meaning when read backwards, for example bone, he, grate, etc. Make a…
-
0
votes1
answer648
viewsHow to read a JSON Object Array with Xamarin Android Newtonsoft.Json
I am working on an app that gets a response JSON and inserts some fields of it into a textfield android, here is the code: using System; using Android.App; using Android.Widget; using Android.OS;…
-
0
votes1
answer307
viewsA vector in C, which updates the values in real time, according to the numbers reported
#include<stdio.h> #include<stdlib.h> #define tamanho 5 struct test { int vetor5; }casa[tamanho]; //funcão para o vetor da struct void recebe (void) { for (int p=0; p<tamanho; p++) {…
-
0
votes2
answers250
viewsJoin two matrices and display them in a third vertically
I created two M1 and M2 matrices and they have a dimension for seven elements. A third matrix called M3 has two dimensions where its first column must be formed by the elements of matrix MA and the…
-
0
votes1
answer38
viewsGet Selected Index
Good afternoon. I want to set the option of a Jcombobox field as the registered option in a given vector position. For a previous text field, I made the following settings:…
-
0
votes1
answer159
viewsPress virtual keyboard buttons according to password
I made a virtual keyboard that generates the numbers and returns in json, for example: [0] => Array ( [a] => 1 [b] => 5 ) [1] => Array ( [a] => 6 [b] => 7 ) [2] => Array ( [a]…
-
0
votes1
answer313
viewsHow to identify elements with repeated values in an array and create a new array
I have the following associative array: Array Actual: Array ( [0] => Array ( [num] => 51 [totalparcial] => 2.50 ) [1] => Array ( [num] => 51 [totalparcial] => 3.70 ) [2] =>…
-
0
votes1
answer150
viewsCreate a multidimensional array in Java table format?
I’m a beginner in Java and have doubts how to create Multidimensional Array, I have the table below How do I create a Multidimensional Array from this table?…
-
0
votes1
answer21
viewsCounting of similar objects in the vector
I would like to know how to count sequences of different within a vector containing only 0 and 1. For example, in the vector x <- c(1, 1, 1, 0, 0, 0, 1, 1) the count would give the vector 3 why…
arrayasked 5 years, 6 months ago Breno Benvindo Dos Anjos 1 -
0
votes1
answer113
viewsSplit array according to payment types
Code of index php. <form action="add-to-cart2.php" method="post"> <label for="">Name</label> <input type="text" name="nome"> <br> <br> <label…
-
0
votes1
answer207
viewsTreat multidimensional array in Angularjs
I have that function: getProducts(){ this.auth.getProducts().subscribe(data => { this.turmas = []; this.produtos = []; this.cursos = []; for (var i = 0; i < Object.keys(data).length; i++ ) {…
-
0
votes1
answer63
viewsPrint a line of a two-dimensional array in Perl
I have an array @data, two-dimensional, and I want to record line after line in a file. I’m doing so, for each line $i: print (ECR $data[$i][0]); for $j (1 .. $lastcol) { print (ECR "," .…
-
0
votes1
answer449
viewsArray_push in php multidimensional associative arrays
I started an array ($arrDados=array();) and now I need to add information (array_push) so that I can access the information later on as follows: colA1 = $arrDados['NumeroEmpenhoAno']['code']; colA2…
-
0
votes1
answer22
viewsHow to subtract extreme indices from the same vector?
I am having difficulty in this exercise, I would like to know how it is possible to carry out this formula operation int main() { int A[20], i, soma, j; cout << "Digite o valor do vetor A";…
-
0
votes2
answers1459
viewsDelete and Query Python function
I have to make a simple program in Python. In the case of a library , however I’m having difficulties in the function of consulting and deleting. I honestly stalled, tried a lot of different ways…
-
0
votes1
answer72
viewsReturn/save problem in a JAVA list
Good night, I have a Master Class: import static javax.swing.JOptionPane.*; import java.util.ArrayList; import java.util.List; import static java.lang.Integer.parseInt; public class Principal {…
-
0
votes1
answer53
viewsOrganize information
I have a text like that: NICK:KEOME PTS:50 ASTS:6 DEFREB:2 OFFREB:7 STLS:14 BLKS:4 TOS:5 NICK:ARTHUR PTS:10 ASTS:3 DEFREB:5 OFFREB:4 STLS:4 BLKS:2 TOS:6 How do I store the information more or less…
-
0
votes2
answers508
viewsHow to check if a String is null and add in an array?
I have a problem, I have several variables (String) with the following names: textTransferd1, textTransferd2 to 73 (textTransferO73). At certain times the variable textTransferd2 for example may…
-
0
votes2
answers55
views -
0
votes1
answer88
viewsConvert String Json CSS Inline to an array or json with PHP
I have a register in the json database and inside it there is a "style" object in which it has an inline css code, for example: "padding: 90px 0px 20px 0px; background: #000000; display: block;"…
-
0
votes1
answer33
viewsReturn of an array’s Indice value
I have an array with multiple positions, as I do to check if a particular Dice is numeric or string?
-
0
votes1
answer2656
views