Questions tagged [dynamic-arrays]

Anything related to dynamic arrays, i.e. array-like data structures where the length of the array (the number of its elements) can be changed at runtime, thus allowing adding or removing elements without explicit memory allocation and management.

Filter by
Sorted by
Tagged with
-2 votes
0 answers
32 views

Dynamic JS Array Declaration from JSON File [duplicate]

I'm trying to dynamically declare/create various arrays based on externally loaded JSON data. I've managed to load my JSON file and access all nested data successfully. Now I need to store this data ...
Mariano's user avatar
0 votes
1 answer
48 views

How to create an array with dynamic size at runtime in Ballerina?

It seems currently it only allows compile-time constants for the array size in the array type descriptor. E.g. const ARR_SIZE = 2; public function main() { int[] arr1 = []; // okay int[2] ...
Nadeeshan Dissanayake's user avatar
-1 votes
0 answers
49 views

How can I put my pointer array in order from smallest to largest, in order to be able to find the median

I am still in my early days of my programming education and I am working on a program in C++ for a past assignment I have been stuck on. I struggle more when it comes to pointers so that's where I'm ...
Joe Forsyth's user avatar
0 votes
1 answer
40 views

Google column chart with a dynamic column count

I have successfully coded several stacked column charts with no problem, all having a similar structure shown in the snippet below: arr.push(['Date', 'Item1', 'Item2', 'Item3', 'Item4', 'Item5']); for ...
LloydC's user avatar
  • 7
1 vote
3 answers
70 views

Excel formula to remove all alphanumeric char from string

Why does this not work as expected? =SUBSTITUTE("HEL3LO";CHAR(SEQUENCE(26;1;65));"") I would expect and result of 3, I get and array of inconsistent results. Any suggestions? With ...
Vsn's user avatar
  • 39
-5 votes
0 answers
57 views

how to determine the number of elements in a dynamic array [duplicate]

string* tempArray = new string[numKandidat + 1]; // ein temparray erstellen das um 1 größer als das aktuelle Array. die Idee ist ein platz für ein zusätzlichen kandidat zu schaffen for (...
El ayoub's user avatar
0 votes
1 answer
87 views

VBA function does not return dynamic array

I am using Excel365. Below function is intended to have SumProduct work with arrays that contain empty cells generated by a formula - when the result of the formula is "", SumProduct has ...
Martin's user avatar
  • 3
0 votes
1 answer
29 views

Transform classic formula to a dynamic array formula

I'm trying to transform my clasic formula to a dynamic array one, but i can't My current working classic formula is =LET( per; B4; data; FILTER(CHOOSE({1\2}; Taula1[Cap];Taula1[Cap]*Taula1[Tipo]); ...
lluis's user avatar
  • 85
0 votes
0 answers
24 views

Parse Json file that has multi nest dictionary in Swiftui

I have a Json file like this, I want to access to one (or random one) of the item in the list (it is similar to the question at this Cant parse JSON (nested dictionary) into ForEach with SwiftUI) { ...
CNunc's user avatar
  • 3
0 votes
2 answers
61 views

Can you dynamically allocate a partially fixed-size array in C (2d array)?

I wanted to dynamically allocate a partially fixed size array, but ran into errors which would lead me to believe I don't actually know how an array like this functions, so I'm trying to figure out ...
Ethan's user avatar
  • 161
1 vote
1 answer
42 views

Remove double values and sum the values

I'm trying to remove the double values of the first column and make the sum of the values in the others column for this double. I'm using dynamics arrays of Excel 365 (In French), I will try to ...
MonkeyJLuffy's user avatar
1 vote
2 answers
48 views

How would you filter out a dynamic array using a dynamic array (Non exact match)?

This is a follow up to the question I posted yesterday. I have two dynamic arrays in excel, as shown in the image. One is C1#, which is the criteria for the search, and one is F1#, which is the ...
Unrequest's user avatar
1 vote
2 answers
70 views

How would you filter out a dynamic array using a dynamic array?

As the image shows, there is a dynamic array consisting of the words "One" and "Two" in column C. Being a dynamic array, it could be one criteria, could be hundreds of criteria. ...
Unrequest's user avatar
1 vote
1 answer
67 views

How to apply number or date format to columns after TEXTSPLIT in Excel

I use TEXTSPLIT to cut text composed of multiple parts, like for example: the country, the date and the value: "USA-01/01/2023-1000" =TEXTSPLIT(A1,"-") Unfortunately, the result ...
Fxp's user avatar
  • 115
0 votes
1 answer
126 views

excel formula - getting sumifs to work inside a let function

Hi! I'm trying to create a formula in excel that does 2 things: Join two tables into one. - I'm using HSTACK function to do so. Add a SUMIFS column in the end of the Jointed table. I'm using the LET ...
user19769122's user avatar
0 votes
0 answers
75 views

Using a dynamic array formula in a dynamic array column

Since we apparently can't use dynamic arrays in structured tables, I'm trying to use dynamic arrays in a dynamic table. Unfortunately, the main roadblock I've run into is looking up data on a ...
Scott McNay's user avatar
-1 votes
2 answers
97 views

IndexError: list assignment index out of range (filling an array in a for loop with count() of objects)

I want to fill the array 'v' with the number of doctors in each department, I got this error : v[i]=Doctor.objects.all().filter(idDept__deptName__contains=s.deptName).count() ~^^^ IndexError: list ...
zlydia's user avatar
  • 17
0 votes
1 answer
73 views

Defining dynamically allocated global device array in CUDA [duplicate]

So I want a device array that is dynamically allocated based on some host variable. This array should be visible to all device functions hence the global scope. I decided to make the use of ...
Areen's user avatar
  • 21
0 votes
0 answers
99 views

How to get size of object with nested objects

Suppose I have various classes nested in one class and some are instantiated using pointers. I will try to provide a simple illustration. The goal is to find the total size of the object. class A { ...
user10299403's user avatar
-1 votes
1 answer
123 views

Delphi directive for “constant length” dynamic arrays?

As far as I know Delphi always allocates a generous space for dynamic arrays to avoid relocation when the dynamic array's size is increased (using SetLenghth(), e.g.) However, in many cases just a ...
Zoltán Bíró's user avatar
0 votes
1 answer
68 views

Using Office365 Excel array formulas, how can a cummulative weighted average price be calculated?

Each day, there is a new sale for a given amount and price. How can a cummulative total amount and weighted average price be calculated for that day with an array formula? Without an array formula, ...
ciso's user avatar
  • 2,887
1 vote
1 answer
118 views

Why do I get realloc(): invalid next size?

I am trying to add elements to a dynamic array of structures in a function. Everything seems to be correct and when I add the first element it actually succeeds but when I try to add another I get: ...
gluhtuten's user avatar
0 votes
0 answers
52 views

Initializing arr_arr_integer

I'm working on the codesignal problem: Roads Building I'm new to C, & struggling to intialize a arr_arr_integer. I'm struggling to find examples in the same context & my intuition isn't upto ...
riverside96's user avatar
0 votes
0 answers
37 views

How do I correctly use a dynamic array in VBA to avoid the Expected Sub, Function or Property error?

Having trouble getting code to compile due to an array name throwing the Expected Sub, Function or Property error. Function is to take two input ranges, one of strings and one of times. Strings are ...
Neon_Loonie's user avatar
2 votes
2 answers
137 views

How can I sum part of a multidimensional dynamic array in Excel M365 with criteria for specific values?

Wondering if it's possible in Excel M365 to sum part of a multidimensional dynamic array, with criteria using a non-looping solution. I am looking to preserve rows of the 'DataTable' dynamic array, ...
Blendr's user avatar
  • 33
0 votes
0 answers
55 views

I need to store dynamic array of struct type in another struct in Solidity

struct ProductQuantity{ string product; //MUDAR PARA PRODUCT uint128 quantity; string unity; string originMachine; //MUDAR PARA MACHINE } struct Movement{ string originMachine; ...
Miguel Macedo's user avatar
1 vote
1 answer
46 views

How can I make a dynamic button array which changes the src of an image according to a dynamic object array?

I am a beginner with Javascript and I am still experimenting with how things work. My knowledge is very limited. Excuse me if I phrase something falsely. I am trying to make a dynamic system in which ...
tnm505's user avatar
  • 13
0 votes
0 answers
53 views

Explaining amortized analysis on dynamic array

So I have been struggling with amortized analysis on dynamic arrays. I have studied through the University of Torontos slides on this topic and this When the array is ½ full after DELETE, create a ...
Alexander Zangerle's user avatar
0 votes
1 answer
135 views

How to overload and use two different operators simultaneously in C++?

I want to redefine the two operators bracket "[]" and equal "=" in C++ language and use them simultaneously. In fact, I want to create a dynamic array and use it like usual arrays ...
the learner's user avatar
0 votes
1 answer
51 views

Why is this UBound not identifying the correct limit?

I am new to using VBA within excel and am trying to implement a function to perform an algebraic operation on an array of numbers. This function requires creation of sub arrays with sizes relative to ...
Max Lovegren's user avatar
0 votes
1 answer
76 views

Reading the contents of a file into a dynamically allocated array in C

So I'm attempting to compare the individual characters from each file inputted which are then read to two char pointers allocated into memory with the size of the two input files. Whenever the entire ...
Zodiac's user avatar
  • 1
0 votes
1 answer
215 views

Is there the possibility to define a lookup array in Excel using a value from a certain cell

I am creating a continuous data set of materials and their inventory in a certain week. I want to be able to lookup what the inventory of a specific material was in a certain week. Through writing the ...
Daan Plass's user avatar
0 votes
0 answers
8 views

How to update object properties on external variable change? [duplicate]

Context: I am trying to create a template builder for emails and I have noticed that I can't update the theme colours as JavaScript passes the values into the object. I have two object's, theme and ...
Lachie's user avatar
  • 1,321
1 vote
3 answers
471 views

Is there a standard C library for dynamic arrays?

One of the greatest things about Python is the flexibility of dynamic arrays (lists). It's so useful I find it hard to believe there isn't a library for this already included in C. This question ...
Connor's user avatar
  • 847
2 votes
1 answer
66 views

How is (uint) index >= (uint)_size better than index >= _size?

I looked under the hood of List<T> and came across the following piece of code: public T this[int index] { get { // Following trick can reduce the range check by one ...
phougatv's user avatar
  • 891
0 votes
2 answers
44 views

How Can I Create a Dynamic Select All That Only Selects Certain Checkboxes Based On Dynamic Input?

I've seen many different variations of my question, but nothing specific to my use case. I am trying to create a form field with multiple checkboxes and have done so successfully. If I do something ...
Steve Smith's user avatar
  • 1,019
-1 votes
1 answer
60 views

ValueError: PyObject is NULL when running some test cases on the dynamic array using python?

That's my implementation of the dynamic array in python with types: import ctypes class DynamicArray: def __init__(self,): self.n = 0 # the current number of elements added to the array ...
Ahmed Fakhry's user avatar
2 votes
2 answers
136 views

In MS Excel, how can I VSTACK a Sequence generated from on start and end?

I have a table with start and end of date-ranges, like this start end 1 5 10 13 20 22 I am trying to create a list of all dates/numbers falling between the start and end (both inclusive). So, my ...
Ashutosh Deshpande's user avatar
0 votes
0 answers
37 views

How to take input from user and store it in array until the user enters a specific word

I want to create a 2D array with the help of user input but the user do not specifies the length of the array. The input taken from the user should be saved in a 2D array. until the user inputs "...
Jay-23's user avatar
  • 1
0 votes
2 answers
366 views

Create a Dynamic Array formula (Excel) to combine multiple results columns into one column that is filtered & sorted using multiple criteria?

The sample data in the image below is collected from a round robin tournament. There is a Round column,Home team & Away team columns listing who is playing who. A team could be either Home or ...
Deewun Xby's user avatar
-1 votes
1 answer
119 views

Static array and Dynamic array in a function

I have a question as below C++ code. this is the code(No function) that can successful execute. #include <iostream> using namespace std; int main() { int size_3 = 3; //arr1 is a static ...
Sherine's user avatar
0 votes
2 answers
112 views

Generate number by using Dynamic array (w/o VBA)

I would like to generate a number from the raw data based on Name in A1# and check with B1# and C1# for each row until the maximum value of D1#. Each rows must be filled with 0 to the limit D , which ...
O.P's user avatar
  • 3
1 vote
1 answer
254 views

Excel--Let & Lambda, dynamic array count of instances

The following formula produces a list of results in a single cell as expected. =BYROW(FILTER(M4#,{1,0}), LAMBDA(a, LET( varARR, SORT(UNIQUE(FILTER(FILTER(rngGapAwarded,((...
RandyB's user avatar
  • 15
0 votes
1 answer
34 views

How do I output the row containing the lowest value from a specific column inside a filtered dynamic array?

I have a list of suppliers which contains the product name and the prices. I then formatted the data where there are multiple entries of the product name but under different suppliers. For each ...
Monxstar's user avatar
0 votes
1 answer
48 views

What dynamic array formula can I use to calculate runway or burnrate in Excel?

I'm using dynamic array functions in Excel (SCAN, MAP, LET, BYCOL, etc); wihtout VBA or regular SUMIF formulas, to create a runway or burnrate-type table. So, I start with a $10,000 budget, month 1 $2,...
juanl's user avatar
  • 3
0 votes
0 answers
23 views

Building an index in Excel

Working in Excel365, what would you say is the most resource-effective formula for building an index from percentage changes? Assume you have a time series of percentage changes of any variable (e.g. ...
JohanVS's user avatar
-2 votes
3 answers
66 views

I am not able to print data from dynamic array

In this problem, I have to create a dynamic array and get data from the user, If the user keep entering value, a new array should be created and the data of the old array should be added to new array....
Muhammad Abdullah BSCS 2022 FA's user avatar
1 vote
1 answer
55 views

Incorrect output for array sorting functions

I'm having the below issues whenever I run this program in Visual Studio. #include <iostream> using namespace std; int* append(int*, int, int*, int); int* merge(int*, int, int*, int); void ...
Marshall Hitt's user avatar
0 votes
1 answer
257 views

How to resize the array in Java?

I have been trying to create my own Array class, which is dynamic, but I can't figure out the problem in resizing the size of it. I created separate function to check if the array is full and for ...
Nikhil Yadav's user avatar
3 votes
1 answer
97 views

Add in dates as a literal in a range

To add in numbers in an array I can do: ={1,2,3} To add in text in an array I can do: ={"a","b","c"} How would I enter in a date? For example, normally I can type in ...
David542's user avatar
  • 105k

1
2 3 4 5
37