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
answer2484
viewsPrint data from a PHP object array
I beat myself a little with return of the database using POO and MVC, and in case I’m bringing the data from the database where the registered date is equal to the current date, the problem is that…
-
0
votes2
answers648
viewsHow to add the values in a loop?
I want to add and show the total value of the consultation. In the case of 3 patients the sum would be 1350. But something is going wrong. case 2 : printf ("Particular:\n"); printf("O valor da…
-
0
votes1
answer45
viewsIs there a function for arrays in Java like PHP Join()?
Is there a function in Java that is equal (or similar) to Join PHP? If yes, demonstrate your use.
-
0
votes1
answer73
viewsCreate a new array with information from an Array sends from via POST
I cannot make a batch change to the information displayed through While. What I want to do is create a new Array with the information I am sending via POST, that is, send the information via POST,…
-
0
votes2
answers31
viewsGet the name of the files sent by the form
I’m trying to get the name of the files after sending the form: add_action('gform_after_submission_5', function ($entry, $form) { $file_url = $entry['5']; $filename = basename($file_url); }, 10, 2);…
-
0
votes1
answer115
viewsmodule.Exports mount an array with the api data
Well I’m having the following problem is I’m not getting it at all. Well I have a script config.js module.exports = { "adsense": { "bloco728x90": { "google_ad_client": "ca-pub-x", "google_ad_slot":…
-
0
votes1
answer690
viewsVector multiplication A and B resulting in matrix C
I have an exercise in Java here to solve but I could not understand exactly what I need to do, if anyone can give me a better explanation thank you! This is what I need to do: Given the vectors A =…
-
0
votes1
answer93
viewsResize array
I have the following question, for example <?php $cesta = array("laranja", "banana", "melancia", "morango"); $fruta = array_pop($cesta); print_r($cesta); ?> the array initial goes from…
-
0
votes1
answer197
viewsGroup PHP Array()
I have the following array() Array ( [0] => stdClass Object ( [usu_id] => 1 [mod_base] => 1 [mod_id] => 4 ) [1] => stdClass Object ( [usu_id] => 1 [mod_base] => 1 [mod_id] =>…
-
0
votes1
answer58
viewsCount True values in an Object
I got this feedback from an API: object(stdClass)[2] public 'data' => object(stdClass)[44] public 'id' => float 3.5795374673835E+14 public 'completed' => boolean false public 'name' =>…
-
0
votes2
answers86
viewsProblem with dynamic allocation of bidimencional matrices in C
I need to make a product of matrices in which the user must enter the dimensions and terms of the matrices, but the program simply stops working. Follows the code: #include<stdio.h>…
-
0
votes2
answers1365
viewsArray permutation
Ladies and gentlemen, I would like to draw up an anagram of the possible combinations. Ex: "123456" would generate: 1234 2341 6531 5431 1243 1342 or 12 43 56 23 14 16, whether or not repeated, and…
-
0
votes0
answers39
viewsHow to copy string from one vector to another vector in C?
I’m trying to create a program that will have a function called substring where the user will place the index position of an origin vector in which it will copy and the size of how many letters it…
-
0
votes1
answer136
viewsVectors and Matrices
Write a program in C that deciphers words from a matrix that contains the values of the letters of the alphabet, as follows: A = 7, B = 8, C = 9, D = 10, E = 11, etc.Thus the code: a) 9 7 10 7, that…
-
0
votes1
answer480
viewsView Page Android - grab list of images within the App and set on the View page.
Guys I have a problem when I need to set my variable in View Page. I have an Activity that searches the images inside the App and arrow in an Array String, until then it is all correct, I use the…
-
0
votes1
answer371
viewsPHP multi-level array_merge. How to do?
I have the following array: $arrIni["ENV"]="US"; $arrIni["sap_db_server"] = "192.xxx.x.xx"; $arrIni["local_db_server"] = "localhost"; $arrIni["local_db_username"] = "root"; //Default settings…
-
0
votes1
answer172
viewsTraverse an array of a php function
I have this function, I would like to go through its values separately but I’m stuck here and I can’t think straight to do a foreach for example. <?php function numeros_pequenos($zero, $um,…
-
0
votes1
answer713
viewsRemove only one value in the array
I have an array this way $arr = array('10', '12', '10', '15', '18', '18', '7', '18', '18', '15'); Four times the value 18. I need to remove from it only one value, example 18, and it remains so:…
-
0
votes1
answer1856
viewsCount rows and null columns of a matrix
Guys, help me on the following question: Write a complete program in C language that declares a square matrix of size 5x5. Then your program must fill this matrix randomly with 0s and 1s (the matrix…
-
0
votes0
answers178
viewsIndex of Vector in C
I have this function which is called through a menu of options: char cad_cliente()//cadastro de clientes { char resp;//variavel de resposta se cpf invalido system("cls");//limpa tela for(int c = 0;…
-
0
votes1
answer65
viewsHow to filter an array in Swift similar to like?
Let cast = ["Vivien", "Marlon", "Kim", "Karl"] would like to return like ('%ar%') "result expected [ "Marlon", "Karl"] "
-
0
votes1
answer401
viewsHow to join two Arrays?
Hello, I have the following problem I have an Arraylist that returns several small arrays of two positions String[] temp = new String[2]; and has the saved arrayList adds several "temp"; ArrayList…
-
0
votes1
answer674
viewsHow to add duplicate values of an object arrayList and keep only 1 of each duplicated object?
Hello I have the following problem and I’m having a lot of difficulty in solving it. I have a code that applies a mathematical formula. This formula ends up being applied several times. each time it…
-
0
votes1
answer286
viewsHow to make a findOneAndUpdate in an array within another array with Mongoose
I am beginner in Mongoose, I would like to make an amendment (findOneAndUpdate) in the second array address in the city field, I tried everything I knew and I thank nothing to everyone who can help.…
-
0
votes1
answer2324
viewsLocating values in a python array and assigning specific values
I have the following vector: posicao = [47, 62, 24, 18, 47, 62, 63, 78, 68, 87, 24, 18, 68, 87, 63, 78] I need to search in this vector the values [24, 18]. After locating them all, I need to assign…
-
0
votes0
answers448
viewsPHP Array for tree format
I’m trying to turn this array Array ( [0] => Array ( [enc] => Array ( [enc_obs] => Continua ) [1] => Array ( [per] => Array ( [0] => Array ( [per_obs] => Continuar mesmo? ) [1]…
-
0
votes0
answers44
viewsAccess data from Array
I have an Array that has the following items: [[362, SCAB171570FEC]] To display this I use the following expression: return $data.listaItensPedido.value; But I need for example to access only the…
-
0
votes1
answer35
viewsDoubt about vector
I am trying to list the numbers that the user type but am not finding the function,someone can give me a light? class Program { static void Main(string[] args) { int[] atividade = new int[6]; for…
-
0
votes2
answers1699
viewsFind out if it is even or odd in array
I’m trying to define the even and odd numbers of a total of 5 numbers entered by the user in a vector. int[] atividade = new int[6]; for (int i = 1; i < 6; i++) { Console.WriteLine("Insira o " +…
-
0
votes1
answer73
viewsFunction reference in Ruby Array
I couldn’t understand what the Ruby relation of the reference of an array variable is like (best and vector) with the return of a function (fitness or bitstring for example). Consider the next case:…
-
0
votes1
answer42
viewsHow to access the contents of this subArray?
I can access the contents of an Array like this: {{teste02[0]}} And I get as return the following: {"assigned_date":"1969-12-31 21:00:00.000","user_id":"101","role_id":"101","group_id":…
-
0
votes1
answer68
viewsPrinting and vector allocation in php cli
I am making a program in PHP that simulates the allocation of programs in a Memory. The problem is that it does not allocate the data in the vector. It prints the vector as if it were the same after…
-
0
votes2
answers82
viewsArrays array loops do not work
Why the y in the second for not "run"? var i = 0; var bd = new Array(); bd[i++] = new Array(10,11,'Daniel'); bd[i++] = new Array(12,12,'Augusto'); bd[i++] = new Array(13, 12, 'Olavo'); See that I…
-
0
votes2
answers305
viewsVector make a mysql query
Hello guys I’m trying to make a query using vector, but as far as I’ve learned the sql command does not hold the vector the way I’m doing so my result is empty variable.…
-
0
votes1
answer171
viewsControl employee point card
I need to make a chart that shows if the employee missed it or not. if you don’t have to show your point beats in front of the respective date. Can someone help me?? Example: In my bank I have…
-
0
votes1
answer2367
viewsPHP foreach Multidimensional Array
I would like to know how to do a model search of a car using the foreach, given the table below: /* Carro modelo ano toyota "corrola","allion","Ranx","mark" 2008 Mazda "Atenza","Demio","MPV" 2000 */…
-
0
votes0
answers110
viewsVector in Opengl
Hello, I’m venturing into Opengl and so far I know the basics of creating figures. I need to create a bar number that goes from 1 to 64, the problem is I need to do this with a FOR. When the first…
-
0
votes3
answers476
viewsGrouping data from a PHP Array
I want to group the data with the same code of this array, I have tried several ways, but so far nothing. Someone has an idea? array (size=5) 0 => array (size=2) 'CODIGO' => string '231'…
-
0
votes1
answer42
viewsError when assigning object to another class
In the code it arrow the values of the employees with the first entered value and ignores the others. for(int i=0; i<3; i++) { Empregados f = new Empregados(); System.out.println("Qual é o…
-
0
votes1
answer55
viewsIdentify repeated indices and exchange only one of them
I have the following vector: a = [1, 2, 3, 4, 1, 3] I need to go through this vector and identify which values are repeated. After identifying them, I need only one of them to be exchanged for a…
-
0
votes1
answer90
viewsStacks with sequential allocation
I’m having problems implementing the code of a stack using vectors: typedef struct pilha pilha; struct pilha { int *v; int topo; int tam_max; }; void Inicializar_Pilha (pilha pi, int tam_max) {…
-
0
votes1
answer402
viewsHow to extract a data from a php array
Good people, good my little script for posts checks if it already exists, if yes it does not record, if not it writes in the comic. I want to put a like system on it, so I created a table but for me…
-
0
votes0
answers337
viewsVector ordering
I’m learning about vectors and matrices, and I haven’t been able to solve a question in the right way for a long time. The statement says: Given some vector, sort it in sequential (numerical).…
-
0
votes2
answers81
views(Error of Segmentation fault)
People don’t know where the bug is. Every time I compile it accuses error of Segmentation fault (core dumped), can anyone help me? The code is here: #include <stdio.h> int strlen(char *s);…
-
0
votes1
answer71
viewsSeparate array by a certain value
I have an array with the jump number and its value. I need to count the value of the jump until it reaches 4.00. And continue this count until the end of the jump. salto 1 => 2,00 salto 2 =>…
-
0
votes2
answers259
viewsHow to return a vector to another vector in Java?
I’m doing a program that applies hill climbing, but the value I need to compare to see if the previous one is better than the next one is a vector double My method to find the best value returns an…
-
0
votes0
answers587
viewsConstructing a java table from a vector as parameter
Hello! I’m having trouble constructing a table. Here’s the thing, the user defines a series of variables that are stored in an array. I would like the variables stored in this vector to constitute…
-
0
votes4
answers437
viewsError checking IF with array in PHP
I’m trying to make a if within a foreach and the situation is as follows: I have a array who I called $plates who returns like this: array(2) { [0]=> array(1) { ["chave"]=> string(1) "1" }…
-
0
votes2
answers1476
viewsPrint components of an array in reverse order
I wrote a code to print the components of a array in reverse order. However, it only returns 5 or 6 numbers (at most), even if I have put more numbers in it. #include <iostream> using…
-
0
votes1
answer934
viewsChange the size of an array at runtime
I’m making a java application, and I used netbeans to build the screen. On this screen I have a button that generates random numbers and puts them inside an array, but I can’t change the size of it…