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
-
-2
votes1
answer71
viewsMultidimensional php array error
I’m trying to find the difference between multidimensional arrays but presents these errors: Notice: Array to string Conversion in C: server htdocs System tests.php on line 319 Notice: Array to…
-
-2
votes2
answers87
viewsProblem involving classes, vectors and tuples
Hi, I’m a little confused about the concept of lists and tuples in Python. In my research I noticed that tuple is a "kind of immutable list", but, despite the definition, I still can not…
-
-2
votes1
answer32
viewsProgram to show the amount of uppercase shows only the amount of lowercase
I wrote a code to receive a char arrangement and return the amount of uppercase letters, but it’s doing the opposite ( returning the amount of lowercase ) and I don’t know why. void Questao4 () {…
-
-2
votes1
answer59
viewsPointer accessed improper data
I’m having difficulty implementing the logic of introducing new employees in the code below. When determining the new quantity and reallocating the vector based on it, the first new employee is…
-
-2
votes1
answer56
viewsFailed to create array
I’m using php 5.3 with Postgree on a project I’m working on. That way I have to use the array() and not the [ ]. I have a table that I need to send by email but when sending only the last record is…
-
-2
votes2
answers225
viewsLogic test inside the Python array
In the R I can have this structure var1 <-TRUE var2 <-FALSE paste0("ANO_544, SEMANA", if(var1 == TRUE){", COD_NEGOCIO"}, if(var2 == TRUE){", CATEGORIA"}, ", MODULADO") And I got an answer:…
-
-2
votes1
answer42
viewsArrayindexoutofboundexception error when trying to store values in the array
I am trying, through the Scanner, to take the values typed by the user, to store in a vector and finally, to average the values typed, in the case the average of a student’s grades. However, I’m…
-
-2
votes1
answer487
views -
-2
votes1
answer98
viewsHow to join fields from a php array
Good evening, so I’m facing a problem with an array, my idea is the following, create an array $MESA[IDMESA] and within that array I would have all information about a particular table that is…
-
-2
votes1
answer29
viewsPHP: Compare repeated items from a list and discard the one from the highest date
Good evening, I need some help with the code below: Inside the variable '$data' I have an array where the id repeats with different dates, I need to discard one of the two arrays repeated with the…
-
-2
votes1
answer265
views"foreach" inside query using PHP PDO " $sql = $Pdo->prepare( )"
Good morning everyone, I’m trying to create a runtime view. For this I need to list all the fields of the table and play within the statement the problem is that I can’t transfer the $obj1[0] array…
-
-2
votes1
answer88
viewsProblem checking for an array
I was doing a very simple old game, and the same done, I wanted to leave the automatic win check, because it was very "hard-code". The way I found to do this was by running a for, and whenever it…
-
-2
votes1
answer497
viewsIdentify if a matrix is triangular upper, lower or diagonal
I need to receive a matrix and identify if it is an upper triangular matrix, a lower triangular matrix or a diagonal matrix (upper+lower) I wrote a code initially to find out if it is diagonal…
-
-2
votes1
answer54
views -
-2
votes1
answer28
viewsreceiving user values other than repeated numbers
Good morning! I’m a beginner in algorithm and I’m making an algorithm that receives from the user an array of 20 integer positions with values between 1 and 20, but there can be no repeated number…
-
-2
votes1
answer25
viewsdisplay array result within phpmailer message
Good evening folks, I need to display the results of an array in a message body phpmailer, so send the same by email. My sending code is working and I have done several tests, the email arrives…
-
-2
votes1
answer38
viewsNot displaying all array values on the screen
I made a call to get JSON values from an external code (PHP). In console.log, shows all the data right, but when I go from jquery to display on the screen, it only returns me the last value of the…
-
-2
votes1
answer64
viewsOrganizing an array based on a field
Well I am mounting an array with a query that comes from PDO it is giving me the result I want, but I do not know if this is the best way to do it. Follow my php code: // Array com os dados…
-
-2
votes1
answer32
viewsArray javascript - know number of agencies I have
I needed to know how many agencies I have in my json file and their respective numbers, in case I know they are 4, but the return being given is an array of 120 accounts only, and I would like an…
-
-2
votes1
answer41
viewsHow to bring the unique values of a list array according to the newest Javascript date
Good afternoon this script only works if my Array is always sorter from oldest to newest date How would you give var dados = [ ["09/01/2020","JOAO"], ["13/01/2020","PAULO"], ["23/01/2020","JOAO"],…
-
-2
votes1
answer73
viewsI’m doing an exercise and I don’t know why it’s going wrong (print exercise in the post attachment and my code below), what’s wrong?
Myio is used by my teacher to replace scanner and etc the strings I’m going to use in the exercise are large and diverse so any example you think about is the basis. is my first post, I’m sorry if I…
-
-2
votes1
answer62
viewsHow to construct an array with 2 subtotals to insert the data into a graph in Reactjs
How to mount an array that sums the values in 2 subtotals? I used the .filter, .map and .reduce to add the values but does not work with more than one category in the same array. var data = [ {…
-
-2
votes2
answers80
viewsReturn Null Print Java
I’m developing an exercise where I need to create a class Ponto and add to an Array of points without me using ArrayList, when testing the first option in the menu I received a return that the array…
-
-2
votes2
answers556
viewsReceive multiple strings in the same row in C
I have the following code that gets the keyboard input and prints on the screen what was typed. #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char…
-
-2
votes1
answer37
viewsC arrays problem
Good afternoon, basically I am trying to make a program that will ask the user to enter 10 numbers between 1 and 100 and with a menu in which the menu will have 5 options at this time I am in option…
-
-2
votes1
answer51
viewsArray formatting
Good morning, everyone! I have a question about formatting an array in javascript. My code is that way. var oidup = ['5006144', '5006146']; //valores oid especifica var oids =…
-
-2
votes1
answer43
viewsShow array first element that may not have been loaded using React
I am developing a quiz application using React for study purposes. I have the state called Quiz, the same consists of: interface QuestionData { id: number; question: string; explanation: string;…
-
-2
votes1
answer255
viewsCalculation of the sum of the elements of a matrix
I have to develop a function in the C language to sum the elements of a square matrix of order n since i < j. I tried to test the function I did, but it gives error in line 15, which says…
-
-2
votes3
answers72
viewsHow to manipulate cells from a vector?
I created a program that fills a 10-position vector with random numbers between 0 and 20. Now I need to show a new manipulated vector, where each cell is the sum of itself and the previous cells.…
-
-2
votes1
answer30
viewsCreate php array, saving how many times a string appears
Good Morning! I have a problem, I have two strings $search and $hostname, inside search I have the full text, and inside $hostname the words I want to look for in the variable $search. Ex of…
-
-2
votes1
answer30
viewsSearch in Javascript array
Good afternoon. I ask you kindly to help me in a simple problem (for you kkk), but that is bothering me. I have a fixed matrix (values are taken from a txt) need a return function another matrix…
-
-2
votes1
answer45
viewsfill an array with Indice
I own the following arrays: $lista_geral= array( 0|7897748704559 =>'', 0|7897748704009 =>'', 0|7897748705501 =>'', 0|7897748704160 =>'', 0|7897748704573 =>'', 0|7897748704238 =>'',…
-
-2
votes1
answer46
viewsRecursive call that returns the beginning and end of a vector
Good afternoon! I’m very lost in this matter of a college job because I didn’t understand right recursion. Could someone help me? I need it here: A function that returns the index in which the…
-
-2
votes2
answers78
viewsExclude element from a dynamic object array
I need to delete a column from a dynamic object array. Example: export interface ObjetoTeste { primeiraColuna: string; segundaColuna: string; } let teste: Array<ObjetoTeste> = [ {…
-
-2
votes1
answer65
viewsWhy doesn’t my summation work?
I have this activity: Write a function that receives, as input, a vector of n > 0 elements of type Cell and return, as output, the sum, of the weights of all vector elements belonging to bands.…
-
-2
votes1
answer30
viewsFilter list by keyword array
The idea is to make a filter. I have a text field that the user types what they want to filter, so I store the typed words in an array. Ex.: The user typed in the "config company" field, the array…
-
-2
votes1
answer44
viewsDatabase using vector and struct in c
People I need to make a program where I save client data and accounts, I’m trying to save the data of the struct in a vector (it was requested this way) but I’m not getting out of place, I don’t…
-
-2
votes1
answer36
viewsHow to deal with arrays with different number of indices in the same loop
I have a script that makes a registration works like this: in a dynamic table, each row has an input that is checkbox type and it loads an id and another input is number type and loads any value…
-
-2
votes1
answer50
viewsCan you convert an array of strings to a double array without concatenating the decimal numbers in the conversion?
I would like that, somehow, after converting the string array to double, the values remain floating point. I put the input as, for example, 5.5 6.5 7.8 2.5 6.2, and during the conversion is not…
-
-2
votes0
answers61
viewsHelp to solve this BUG, I am beginner. C Language
Follow code in full, below. I’m quite beginner yet, so there may be more mistakes. #include <stdio.h> #include <string.h> #include <stdlib.h> #include <locale.h> //Var char…
-
-2
votes1
answer33
viewsHow to solve product scalar without using numpy library (python)
Hello, I’m trying to do this operation without using the Numpy library, which in itself is already a tragedy. I get from the user two vectors of equal sizes, and need to do the scalar product…
-
-2
votes0
answers41
viewsHow to Map String Characters
I have the following array with a string inside. let fruta = ['banana']; fruit is the name of my array and banana is the string. my intention is to create a code that Mapeie the string 'banana'…
-
-2
votes0
answers23
viewsConcatenate Object Array with length
Good night, I have the following doubt, I have 2 arrays of objects being the first of cars and the second of sales, having the second one a relation through the car id. I wonder how I can…
-
-2
votes0
answers24
viewsHow to scroll through a . csv file and jump to the next line via Javascript?
I have a file .csv with 3 columns separated by comma, I need to go through this file and each row skip to the next until the end of the file, but when going through this file in my for it is always…
-
-2
votes1
answer16
viewsTable with rowspan using array
I’m having difficulty making foreach with array, being 2 columns with rowspan and other 2 columns showing array of products of each furnace. See the example below of how it should be. <table…
-
-2
votes1
answer54
viewsChange in Array Value
I started learning about C, and asking some questions of URI I found a mistake I don’t know how to fix. When entering the values inside the shot array, it inserts all the values correctly, but when…
-
-2
votes0
answers25
viewsput Array of Label objects into Sort numbers?
I’m creating a Label array where the Label Input label creates 12 numeors from 1 to 25, random numbers in ascending order, an Input text where it receives 3 numbers that are added by the user, with…
-
-3
votes2
answers82
viewsfill as data an Array up to a specific value
I need to make a program that reads the keyboard names until the user type the word "order", and then print the typed names in the order they were typed. So far, I’ve tried to resolve this issue…
-
-3
votes1
answer64
viewsHow to retrieve specific information within this array?
I made a query SQL in the Wordpress database that returned me all the information related to a request, but I need to store some variables of this information and do not know how to do. The $pid…
-
-3
votes2
answers261
viewsHelp in Java: Arrays
Exercise: Make two lists of names in the form of arrays, compare how many names on List 1 are on List 2, and then calculate the percentage of these, about the percentage of total people on List 2.…