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
votes5
answers1205
views -
1
votes1
answer76
viewsAdd multiple indices of a vector as parameter
I’m starting in JAVA. I created two classes, the class Pessoa, which receives the following parameters at the instantiation of a new object: public Pessoa(String nome, int idade, char sexo) And the…
-
1
votes1
answer28
viewsReturns value of an array dynamically
I have an array $teste = [1,2,3,4]; <Input type="text" value ="teste[0]" /> //retorna "1" How I could bring all array values into inputs?
-
1
votes1
answer136
viewsC# - How do I check if 2 arrays have one or more numbers in common?
How do I find that in the numbers of 4 Textbox that are in the array numeros, are on the array impares or pares, what are these numbers and how many are odd and how many pairs? int[] numeros = new…
-
1
votes1
answer3156
viewsdoubt Array.push() Javascript
Hello! Could anyone tell me why the push method is only saving the last item in the array newArr? My goal is to extract an array with the permutation of past and console.log() it comes out right,…
-
1
votes2
answers87
viewsMultidimensional array list
I have this bond: aaff = [];contador_selecionados=0; $(' .values .layout .acf-input').children('').each(function(index,element){ contador_selecionados++; aaff.push( element.value);…
-
1
votes1
answer586
viewsMerge two objects into one with conditional attributes in Javascript
I have the following dilemma, I need to assemble an object to send to a API rest. But I have data that starts from a variable. I thought of several ways to do this but I don’t know which one is…
-
1
votes1
answer178
viewsArraylist repeating itself
I have an array that whenever I refresh my page, it duplicates. I did some tests to see if it was duplicated in Javascript, but found nothing. This is the Javascript: <script…
-
1
votes1
answer248
viewsHighest value in a fixed vector of 10 positions
I have pending exercise to find the largest element in a fixed vector of 10 elements. However, when declaring the array integers works, but when I ask the user to enter the values does not work. int…
-
1
votes1
answer1133
viewsCreate dynamic inputs from a json object
I have a form that the user can add several languages who can speak, this form consists of a dropdown and a button to add the respective language. At the moment I click on the add button it adds new…
-
1
votes1
answer599
viewsHow to check if an array has an attribute?
I’m using Laravel 5.4 in an application, and a validator method receives a array. That one array can have the attributes: [ 'nome' => $request->nome, 'ddd' => $request->ddd, 'fone' =>…
-
1
votes1
answer692
views -
1
votes1
answer1391
viewsSave data from a textbox to a class and display on a datagrid
I am making a program for simple registration, without using database, only with array. The program was already functional when I noticed that the most important part was wrong because I had not…
-
1
votes2
answers767
viewshow to create a vector vector?
Can anyone tell me how to create a vector in java? i.e.: How to make a vector store other vectors with int values this loop populates a vector with values from 1 to 4 q are directions N=North,…
-
1
votes2
answers2210
viewsView associative array elements with foreach
Hello, everyone. I would like to display the elements of an associative array as follows: Nome: José Idade: 32 Profissão: Médico Nome: Rafaela Idade: 28 Profissão: Dentista All on the same page. And…
-
1
votes1
answer195
viewsScanning an entry by scanf does not walk in the string beyond the white space
I’m trying to make a program that reads a sentence and then capitalizes every initial of every word, if not already. The problem is that I type in a sentence but it only returns the first word,…
-
1
votes2
answers208
viewsDeclaration of a global array of C structures
I created a structure cliente and the next idea would be to create a array clientes. My idea would be to declare array clientes globally, so that all functions can interact without passing it as an…
-
1
votes2
answers164
viewsQuivalent method to array_diff() in JAVA
In PHP there is the method array_diff() which verifies values of two arrays and returns the items referring to the difference between them. For example: $arrExclusion = array('as', 'coisas',…
-
1
votes2
answers907
views -
1
votes1
answer401
viewsArray storage
I have a question about storing information in array, I thought, when inside a loop, an array of size 200, for example char nome[200] it would be populated continuously until there is no more space…
-
1
votes1
answer64
viewsMerge or combine PHP Array
I’d like to combine two arrays ($a and $b) in such a way $c = $a[0]$b[0],$a[1]$b[1]...$a[n]$b[n] how to proceed there is a function I tried to do with foreach but without success. $array1 =…
-
1
votes1
answer35
viewsDoubt to level array after consulting SQL with Eloquent
Hey, guys, I put together the following code: $concat = array(); $products_categories = array(); $departament = $request->getParsedBodyParam('departamento'); $categories =…
-
1
votes1
answer45
viewsCheck for string in a PHP multidimensional array
I have the following array: array => [ "c2_unid" => array:2 [ 0 => { "tipologia": "Tipologia" } 1 => { "c2_unid": "Tipo" } ] "c1_unid" => array:2 [ 0 => { "disponibilidade":…
-
1
votes1
answer317
viewsJSON formatting created in PHP
I am creating a JSON that needs a specific formatting in PHP, the problem is that I can’t make it look like my JSON template, follow template and my PHP: Model: { "success":true, "message":"",…
-
1
votes1
answer50
viewsJS moving in variable that doesn’t have to move
I made a code that groups some items closer in one, by position x and y. The code is doing correctly, but I am facing a problem. The first time the function runs, it does all process normally. When…
-
1
votes1
answer1567
viewsHow to compare, remove equals, etc elements of two vectors in java?
I am doing a work in java to perform operations together, but as I am learning now I do not know how to compare the elements of vectors to make the following operations, union, intersection,…
-
1
votes2
answers407
viewsHow to Store Splitted Strings in an Arraylist?
I’m doing a job where I need to save the information from a current account, I need to read the information from a file (text) and split this information into account code, name and balance. Also, I…
-
1
votes1
answer50
viewsReturn sum objects of an array in one
Next, I’m a designer and I’m slowly learning javascript. One of the things I have the most difficulties with is objects and arrays, so I’m focusing more on that now. I have an array with 4 objects…
-
1
votes2
answers1136
viewsPerform search inside javascript object and return value
i need to do a search inside a javascript object that brings me the sku according to size and color, vcs can give me a light? Example: I need to insert in a variable the product sku that has the…
-
1
votes2
answers2037
viewsPass an array of objects via AJAX via POST and read the properties of objects in PHP
I’m having some problems solving this situation. I’m trying to pass my object array via AJAX to another PHP page and read the properties that are inside each object within that array. For you to try…
-
1
votes1
answer922
viewsSave query results to an array
good afternoon! I need to get the results of this query: sql = "SELECT controle.ID FROM controle WHERE BP = '" & controlectform.nmbpbox.Value & "';" And save to an array. Later I’ll do a for…
-
1
votes1
answer49
viewsException in thread "main" in String array
I would like to add the text inserted by the user in a vector position, but it is giving error... why? public static void main(String[] args) { int cont=0; String inserida =…
-
1
votes1
answer119
viewsTake values from an Array and implement within Json using php
How do I get the values of this array array(2) {["Premium"]=>array(3) {["valor"]=> string(3) "100" ["quantidade"]=> string(3) "200" ["status"]=> string(1) "1" } ["Arena"]=> array(3) {…
-
1
votes3
answers115
viewsHow to access an array and export variables?
I have a code that receives the data via $_POST on a form as follows: ... $certificate = $_POST['certificate']; ... If you make a print_r($certificate) the result is as follows: Array ( ['cliente']…
-
1
votes1
answer130
viewsRecording only the last line in the BD
I am making a form to enter products in stock (NF mirror) for this I am using a Cód in javascript to clone the lines. So far so good, the problem and the time to have register because it only…
-
1
votes1
answer36
viewsSort 2 arrays with different sizes in jQuery
I have the following problem, in my scenario I am capturing the Ids of a checkbox, I have a list of JSON objects where I need to compare these Ids with the Ids from the list of JSON objects. The…
-
1
votes1
answer105
viewsCharacter array does not save correctly
I’m making a program to encrypt according to Caesar’s Cipher in Java. I came across the following problem in code: package projects; import java.util.Scanner; public class Projects { public static…
-
1
votes2
answers374
viewsSUMS with reference within the array
I would like to use the following formula:: =SUM(SUMS(A:A;B:B;{"car";"bicycle"})) It turns out that I do not want to leave the criteria "car" and "bike" fixed, I would like to put in there a…
-
1
votes1
answer104
viewsC++: Vector in a function
I’m doing a project where I use many vector vectors. Only working with array vectors is easier, so I did the following function: // add.cpp vector <string> sAdd (string In[]) { vector…
-
1
votes1
answer137
viewsHow to treat each value of an array without knowing the index name?
Here’s the thing, I’m creating a function that takes an array and turns the writing into uppercase, the code is the following: function uppercase($post_array) //ok {…
-
1
votes1
answer39
viewsHow to check an array quickly?
Hello, on my system I get a request in JSON format and soon after it is decoded. This is the mandatory model that the requisition must have. array ( "client_id" => "", "credentials" =>…
-
1
votes1
answer234
viewsDynamically creating lists and saving their addresses (top of list)
Hi, I’m doing a college paper on Hash table and I’m having some difficulties. I will try not to complicate too much (to tell you the truth, the execution of my code helps me to understand what I…
-
1
votes1
answer54
viewsMáquina Dobradora
I’m studying for a programming challenge at College and my teacher gave some programming exercises to train. It was proposed the folding machine, but I am not able to develop the input process, in…
-
1
votes1
answer361
viewssystem() does not accept string type variable in c++
In order to automate some backups that need to be done routinely, so I thought of using an dos to do, but I’m having trouble compiling the executable because it seems to me that the function…
-
1
votes1
answer125
viewsWhat is the difference between char (*ptr)[20] and char *ptr[20]?
I’m studying pointers and came across these statements, but I couldn’t understand it very well. Could you help me? Thank you.
-
1
votes2
answers367
viewsSort an array in Javascript
Hi. I have a problem, and I can’t seem to fix it. I have a text inside an array with several random letters. Ex:"vwv rhjs vqgvcq pjdvb gjpsmc jsm zhctgvl jwgbbs" and so on, it’s 600 words. I need to…
-
1
votes1
answer340
viewsTo return multiple rows with sql Server byte array
I need to perform a query, in a table, where the data is of the type varbinary(max), then created the method below: public List<byte[]> preenche_fotos(string nCrm) { consql.bd_string();…
-
1
votes1
answer15619
viewsFind an item in the list
Make a program that manages the result of the entrance exam. For your happiness, there is only one course and the course has 10 vacancies. The program must keep the list of the 10 classifieds. The…
-
1
votes1
answer255
viewsProblem using vowel lists and even numbers
The exercise is as follows: Make a program where the user type a letter and a number integer. If the letter is vowel and the number is even, or the letter is consonant and odd number, show…
-
1
votes1
answer279
viewsError: "error: array type 'int [sizeExcedent]' is not Assignable"
When trying to compile the program I get the following message: error: array type 'int [sizeExcedent]' is not Assignable uppercase = vector II; ~~~~~~~~ ^ error: array type 'int [sizeExcedent]' is…