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
votes2
answers44
viewsC# - Adding indices from an array and filtering for common results
I need to create a for that goes from 10 to 99 and then I need to print inside an if all the values that we summed up resulting in 11 (for example 56 = 5 + 6 = 11) So far my code is like this class…
-
0
votes1
answer119
viewsFilter Data from a PHP database list from an Input
I have an input text with the event onkeyup in which I type a word and it is comparing to a database list and returning a button with the same case.. I want that in the course that I type go…
-
0
votes1
answer106
viewsDistinct number problem in java
package totoloto; import myinputs.*; public class Totoloto { /** * @param args the command line arguments */ public static void main(String[] args) { int aux, k = 0, l, i, j, u; int t = 0, s; int[]…
-
0
votes3
answers218
viewsDictionary does not return all possible words
The idea of the program is to be a dictionary, the user informs the word, the program performs a check on the characters of the word finds the position in the vector and returns the definition if…
-
0
votes1
answer43
viewsHow to add a number to an array?
Hello! All right with you? I’m making a code and I needed to define a function: def sigmoid (v): return 1/(1+np.exp(-v)) Only what I’m assigning to the function is an array 2d. My question is: in…
-
0
votes0
answers40
viewsSearch and List through Json_decode
I have the following tables: When doing the brand search through the input post, I need to list all products that contain the selected brand id. Below is my passage. $marca =…
-
0
votes1
answer40
viewsWhy is a vector in C passed as a parameter by reference?
Why all other types of variables passed as a parameter to a function are passed by value and the vector does not?
-
0
votes2
answers59
viewserror: expected Expression before struct
Why are you making a mistake? Why? Error = |21|error: expected Expression before 'Simple list'| #define MAX 25 typedef struct Rota Rota; typedef struct ListaRota ListaRota; typedef struct…
-
0
votes1
answer40
viewsHow do I guarantee unique numbers on a list of lists?
Good evening, I’m trying to make a 5x5 bingo card, using Andom to generate the values, however there can be no equal numbers. I tried to do it that way but it still comes up equal numbers: import…
-
0
votes1
answer107
viewsHow to concatenate two strings into C without using <string library. h>?
#include<stdio.h> #include<stdlib.h> int main(){ char vet1[20] = "Bom "; char vet2[20] = "dia"; for(int i=0; vet1[i]!='\0'; i++){ for(int j=0; vet2[j]!='\0'; j++){ vet1[i]=vet2[j];…
-
0
votes0
answers149
viewsCheck for the word in the string using string array and separate the string in a new array
I’m in a problem where I want a string to become an array with separate words, only the code returns duplicate arrays var string = 'xicara,cafecafe'; var array1 = ['casa', 'xicara', 'xicarada',…
-
0
votes1
answer26
viewsHow to sum the lines of a two-dimensional vector and show the result of the sum of each line?
for (int i = 0; i < vetor.length; i++) { for (int j = 0; j < vetor.length; j++) { soma += vetor[j][i]; } System.out.print("Aluno " + (i + 1) + " : "); System.out.println(soma + " "); }…
-
0
votes3
answers406
viewsPHP array that is not getting values
The goal of the exercise was to create an array of 20 numbers ranging from -100 to 100. I have to distinguish between negative and positive values. If it is positive I have to add the value in its…
-
0
votes1
answer17
viewsAvoiding arrays as values when using array_merge_recursive()
I have the following array: $vagas = array( '2017-09-22' => array( '11:30' => 2, '12:00' => 3, '15:00' => 1 ), '2017-09-23' => array( '9:00' => 5, '10:00' => 3, '11:30' => 2…
-
0
votes1
answer61
viewsfind repeated values in the vector in c
I need to create a code that given a number vector it needs to check where it contains repeated values and subtract 1 in the size of the vector whenever it finds, but it is giving time limit error…
-
0
votes1
answer46
viewsAdd value of Childrens nodes to value of parents in array recursively
Good afternoon. I have the following array structure below, how to sum the values of node_value from children to values node_value of parents, recursively? Array ( [0] => Array ( [node_id] =>…
-
0
votes2
answers678
viewsConvert String to Array - Java/Groovy
I need to convert a variable string in a array, I tried to do as follows, I have the variable string conteudoLote, where its value is: [["4","SCAB171301BF5","Vazio","Lexmark…
-
0
votes2
answers681
viewsHow to Create an array from text snippets of a string?
Could someone help me, with some method, function or what is available, to make a string become an array made of pieces of the same example string: var string = "stackoverflow"; var array = [];…
-
0
votes2
answers835
viewscheck if value exists in the array, if it does not exist save the data that does not exist in another array
$array = array( 'b_E_'.$cnpjClie.'_'.date('Ymd').'_A.'.$ext, 'b_M_'.$cnpjClie.'_'.date('Ymd').'_A.'.$ext, 'b_M_'.$cnpjClie.'_'.date('Ymd').'_B.'.$ext, 'b_M_'.$cnpjClie.'_'.date('Ymd').'_C.'.$ext,…
-
0
votes0
answers34
viewsI made a code to send on the screen the number of Cpf, It is working but acknowledging an error!
<?php include"conectar.php"; $query="select cpf from teste where cpf = '" . $cpf . "' order by teste"; $stmt=mysqli_query($con,$query); if($stmt) { $today = date("d.m.y"); } else {…
-
0
votes0
answers44
viewsHow to check the change of an Array in JS
I have an object array and want to perform a function when it changes its value (adding or removing the items). I’m using the md-checkbox of Angularjs with the checklist-model to include values…
-
0
votes1
answer45
viewsPHP $_POST is not being created when you submit the form
I have a form whose method is POST: <form action="/includes/process.php" method="post"> <input type="hidden" name="breakDown" value="1" /> <input type="hidden" name="string" value="2"…
-
0
votes0
answers14
viewsHow can we draw numbers on two Cells in Javascript and the numbers cannot be equal?
I’m like a doubt. I created two cells in html with a button and did Math.Random to draw numbers from 1 to 10 in these two cells, only I don’t want equal numbers to appear, there can never be equal…
-
0
votes1
answer75
viewsCheck that all sub-rray items are in "false" status
I have an array(parent) and within it I have two more arrays. The child arrays exist a property status. I would like to know how I can validate that all items in the array are with the property…
-
0
votes1
answer22
viewsHow to use Scanner to define the characteristics of the "product" object
public static void cadastrarProduto(String nome, int codigo, int quantidade, double valor) { var produto = new Produto(); Scanner leitor = new Scanner(System.in); nome = leitor.next(); produto.nome…
-
0
votes2
answers47
viewsStruct array accepting more than defined, what’s wrong?
In the code I created a array of the kind Pessoa containing only 2, but when it starts to iterate on the for loop and accesses index 2 and 3 the condigo continues without generating error at compile…
-
0
votes1
answer248
viewsHow to receive my array on the JSP page
public void Pesquisar(){ try { Class.forName("com.mysql.jdbc.Driver"); try { Connection conexao = DriverManager.getConnection("jdbc:mysql://localhost/CadastroProdutos", "root", "maquinarafa");…
-
0
votes1
answer543
viewsFPDF with Mysql and PHP - Bringing Repeated Data
I’m trying to set up a generator system Vouchers/Tickets I have a table in SQL with the name Vouchers with multiple users and their respective passwords. I call in each Cell the variable…
-
0
votes2
answers622
views -
0
votes1
answer219
viewsLogic error with MOD (%)
Good evening guys, I’m with a code that shows me wrong values, in my view, my logic is correct but when I request result what is shown has nothing to do with the final objective of the code. I have…
-
0
votes1
answer27
viewsI can’t get an array
I’m trying to get a value inside an array, but it doesn’t print out anything from the id field, which is the field I want to pick up $jsonc =…
-
0
votes3
answers781
viewsPrinting schedules at predetermined intervals
I’m trying to make a code that will print the hours in a certain interval. <?php //Array com os horarios que possam ser imprimidos $hora =…
-
0
votes1
answer143
viewsUse toLowerCase() on a string array - Angularjs 5, Typescript
I’m trying to transform an array with strings inside in lowercase using toLowerCase, but it doesn’t seem to work with an array, but only with a string... How do I fix it? items: Array<{tag:…
-
0
votes1
answer89
viewsUsing data from an array of one class in another
How can I use the array palavra_vetor in another class. public class Lista{ String palavras_leitura [] = new String[50]; String palavra_vetor[] = new String [4]; String palavra; public void…
-
0
votes2
answers156
viewsHow to validate an upload by file name?
I am trying to validate the upload of a file , and the same should always be called new.mpg, if not, the program will not work. function validarNomeArquivo(){ //variavel que recebe o nome do arquivo…
-
0
votes0
answers136
viewsError with array passing in foreach
function preencherJason() { document.getElementById('json_prod').value = ''; var arrayProduto = []; var table = $('#products_table'); table.find('tr').each(function() { var nodesTd =…
-
0
votes2
answers120
viewsCollecting data from an array
I’m having a workout for college but I’m lost in my logic and how to solve it. I have to collect the game results and set the score for each result. the winner takes 3 points, a draw guarantees 1…
-
0
votes1
answer156
viewsHow do I print array on the selected segment and location one at a time?
<div class="col-md-2 col-sm-2"> <form method="post" action="atracoes_resultados.php"> <h4>Escolha o Segmento:</h4> <input type="checkbox" name="csg[]"…
-
0
votes0
answers723
viewsCheck neighbor in a matrix
I have the following problem: I have a large matrix [10x10 for example] It has values from 1 to 9. I must check whether a vector [1, 2, 3, 4, 5] (for example) is contained in this matrix. When…
-
0
votes1
answer51
viewsError with C array - Norwegian
I’m having error signing an array: Menu m = Menu(); m.Options[4] = {"teste1","teste2","teste3","teste4"};//Erro aqui m.Show(); Menu Class: class Menu { public: String Options[]; int index = 0; int…
-
0
votes0
answers186
viewsReturn string array in c
I am trying to return an array of strings to use later in main. Here is my function: char **separar_palavras2() { setlocale(LC_ALL, "Portuguese"); FILE *arquivo; arquivo = fopen(ftexto, "r"); int i…
-
0
votes1
answer333
viewsSend Array to BD
Good afternoon, you guys. I’m trying to pass an array that retrieves a JSON to the BD, but I’m not able to identify the objects of the Array, I think I’m doing something wrong, I did some tests with…
-
0
votes1
answer1550
viewsAdd row and column values and store in vector
Good afternoon, I am making an algorithm in which I need to store the total sums of each row and each column in different vectors. For example: vector A of 5 positions receives the sum total of 5…
-
0
votes1
answer1119
viewsHow to check if the matrix is symmetrical?
I’m doing a college activity where you ask to check whether the matrix typed by the user is symmetric or not. Here is my code: #define TAMANHO 4 #include <stdio.h> #include <stdlib.h>…
-
0
votes1
answer175
viewsunmount objects in an array
I have a method of searching the bank that brings me the following result: Note that inside the Object[4] comes another array that contains People, People.. i would like you to return me just this…
-
0
votes4
answers289
viewsPhp Array - Associating data
Hello, I would like to associate the data of chosen in checkbox, with those of an input. I have on one side, a list of results, where I will select in a checkbox, and each one will receive a new…
-
0
votes1
answer475
viewsCreate Array using SELECT output
public class TelaGrafico extends javax.swing.JFrame { Connection conexao = null; PreparedStatement pst = null; ResultSet rs = null; /** * Creates new form TelaGrafico */ public TelaGrafico() {…
-
0
votes1
answer95
viewsNull object array - Android Base Adapter
Hello I was making a gallery, I created the Adapter, worked normally, so proceed to the step of listing files in a directory and then put in the list: ArrayList<GalleryItem>items = new…
-
0
votes0
answers32
viewsget_where to PDO
I want to change get_where to mysql or PDO, but I don’t know! Help ...! public function get_where($table = '', $where = NULL, $limit = NULL, $offset = NULL) { if ($table !== '') {…
-
0
votes1
answer83
viewsStack insertion vector returning all zero
These days I posted the algorithm of this address below here because I was having problems to pop and remove was solved so far. Destamping Dynamic Stack But as I was reviewing the code and therefore…