Skip to main content
1 vote
1 answer
122 views

I'm trying to write a queue that will store strings. Using GDB I can tell that I make a memory allocation error in the function resizeQueue. Here's the exact message: Program received signal SIGTRAP, ...
user31051859's user avatar
11 votes
2 answers
367 views

The following two codes behave as expected: char* test1 = new char[20]{"abc"}; cout << test1; Outputs: abc int size = 20; char* test1 = new char[size]{'a','b','c'}; cout << ...
petat_irrumator's user avatar
3 votes
1 answer
169 views

I'm super duper new to coding and I'm just learning this as a hobby. I'm following a course and this is the code I wrote (user input to a dynamically created array): #include <iostream> using ...
Ellon Feyneth's user avatar
6 votes
2 answers
201 views

I have a user-defined class Person and I want to create a variable-sized array (size taken at runtime) of Person pointers. The following code works as expected. Person **arr = new Person* [size]; ...
Newton's in-law's user avatar
0 votes
0 answers
44 views

I'm facing two related problems while working with VBA in Excel. Both involve complex formulas, but they behave differently when set through VBA compared to when entered manually in the Excel UI. ...
Handsome Green's user avatar
-3 votes
1 answer
171 views

I am sorry if the question is stupid. The problem is that memory for my dynamic array inside a static structure is not being allocated. The reason might be my pc (it is a really old notebook with only ...
Safarov Arthur's user avatar
0 votes
2 answers
84 views

I am looking to add a sortby or sort function into my query but can't figure out how. =TAKE(CHOOSECOLS(FILTER(Revenue,(Revenue[Top Product]=$C$66)*(Revenue[Location]=$C$67)),1,2,17),10) Here is what ...
Matt9080's user avatar
0 votes
2 answers
161 views

I have a code where I need to delete last element of array. I made this code but I am wondering is there a more optimised way of doing this? My version: void DeleteLast(int** array, int* size) { ...
Safarov Arthur's user avatar
0 votes
1 answer
220 views

I am looking to make a pre-existing function more dynamic such that the user can readily change the filter conditions without needing to delve into the formula and changing manually. I would prefer a ...
Eng001002's user avatar
-1 votes
1 answer
90 views

I am working with flex/bison to create an interpreter for a class. The problem that I am encountering seems to be related to using/converting a dynamic vector. I am trying to create a function to ...
Justin Smith's user avatar
1 vote
2 answers
186 views

I have a dynamic array, and I need to maintain a pointer to it. Here's the setup: var Controls: TArray<TControls>; Items: ^TArray<TControls>; begin Items := @Controls; end; The ...
zeus's user avatar
  • 13.3k
1 vote
2 answers
440 views

I have a array with JSON strings and each JSON has a different key. Also, the size of the array is not fixed and may increase or decrease in occurrences. An example of this is below : "[{"...
Anupam Chand's user avatar
  • 2,779
0 votes
2 answers
103 views

I was reading about CPython’s implementation of list.pop(k) method and learned that it takes O(n-k) to remove the kth element of the list since it needs to move the posterior elements one position to ...
Osniel Teixeira's user avatar
0 votes
1 answer
113 views

I'm a computer science student and one of the questions on a test asked to implement realloc in C using malloc. My teacher said the correct answer would be to get the sizeof of the previous array and ...
PublicEnemy0's user avatar
0 votes
1 answer
57 views

I am new to C++ and I do not understand why the code doesn't continute tokenizing the text array, and instead raises the error. I suspect that the problme might be because of passing the token ptr mid-...
Astor's user avatar
  • 3

15 30 50 per page
1
2 3 4 5
126