Questions tagged as 'array'

1
answer

Problems with Realloc

Good afternoon, I'm having trouble creating a program that will increase the size of a designated list structure, similar to an array, whenever the occupancy rate of this list is more than 80% filled, I would like to increase it 2 times the size...
asked by 14.05.2018 / 19:54
1
answer

How to declare a multidimensional array using new

How do I declare a multidimensional array using new? A normal array looks like this: int* ponteiro = new int[5]; But int* ponteiro = new int[5][5]; Do not compile! but int array[5][5]; works perfectly.     
asked by 29.05.2018 / 19:30
2
answers

Error adding each row of a 5x3 array

Hello, I'm having a problem adding up each of the rows in my array and storing it in a vector My code is like this: #include <stdio.h> int conta(int * matriz[5][3], int * vet) { for (int i = 0 ; i<5; i++) { for (int j =...
asked by 06.11.2018 / 23:15
1
answer

Why is it possible to change constant values in JavaScript arrays?

Having the following code: const arr = [1,2,3]; console.log(arr); arr.push(4); console.log(arr); arr.pop(); console.log(arr); How much of% should not be constant? And why should not you accept the method arr and push() ? After...
asked by 24.01.2018 / 13:55
1
answer

Maximum size possible to allocate a vector

Folks, I have a data structure project that is used to analyze search algorithms in the largest possible vector that my machine can allocate. Can anyone help me figure out how to create a vector of maximum size? The language is C ++     
asked by 14.03.2018 / 17:29
2
answers

Javascript does not get changed array before the click

I have a click code: var layerMap = []; $(document).on('click', '#TipoMapa', function(){ console.log(layerMap); }); And I have a code that changes the layerMap variable: $(document).on('click', '#tipo', function(){ layerMap['...
asked by 19.12.2017 / 14:12
1
answer

Rule PREG MATCH appropriate

I created a loop that shows all the months of the year with the following code: for($i = 1;$i <= 12;$i++){ } Then I created a $ _GET variable that would receive a rule like the following: 1,2,3,4,5,6,7,8,9,10,11,12 This is the $ _GET...
asked by 20.11.2017 / 17:27
1
answer

HashTable: Segmentation fault when inserting - C

I'm trying to implement a hashtable, in which the table would be an array of "buckets" where each contained user information, my code: #define tam_inicial 23 typedef struct user{ char nick[6]; char nome[26]; }user; typedef struct has...
asked by 18.05.2018 / 22:37
1
answer

Go through Arraylist from object objects and compare them to C #

I was wondering how I can reuse the object that I put in an array list because I can not compare it to anything, and how do I compare an object that is inside it with another, in that college program the goal was to user to put the number of sha...
asked by 17.10.2017 / 12:05
1
answer

Compare a string array with another string array and create a new array

I need a method / algorithm found in array1 strings of array2 and create a new array ( array3 ) with all stings separated from array2 . For example array1 = ['azxsdfghjkazxfgtfgt']; The array2 would...
asked by 18.10.2017 / 17:19