Questions tagged as 'array'

2
answers

Reset position of a vector to ensure there is no dirt

How do I zero the position of an integer vector, for example, to ensure there is no "dirt" when allocating the position in memory in C ++? Some language function or algorithm.     
asked by 16.03.2016 / 13:31
2
answers

Store vector file contents in C

I need to read a text file and store each word of the file in a vector position. The reading was done normally and the file was passed by parameter such as the number of words. The code performs strange storage. When I try to print, a random...
asked by 06.12.2015 / 07:13
1
answer

Generating valid Php Array for jSON conversion

Explaining a little bit about the purpose of the code: Through the query sql returns data, the only data needed is the 'id' and the name of the 'area', so two arrays are created, one to receive the 'id's and the other to receive the 'area's', af...
asked by 11.12.2015 / 22:28
1
answer

How to extract a certain index within this array with a for?

I would like to extract all the [Foto] indices from this array but I still do not understand correctly how to do this because I am still struggling with array multidimensionais learning. What I was able to do was extract 1 photo...
asked by 25.11.2015 / 16:35
2
answers

I can not do division with an element of vector

I made a code to simulate the Monty Hall paradox, so that I can simulate 1000 times the results and write the statistics. However, I can not divide an element from an 'array' of 'int' by an 'int', every time I run the program, when it arrives in...
asked by 24.11.2015 / 23:01
3
answers

Query mysql with subquery in NodeJs

I have the following structure in the following tables. partner (idPartner, name, email, phone) example Tag partner (old id, tag) What I need to do, a select in the partner table and make a is in the result and query the tableTag partner b...
asked by 14.04.2016 / 22:59
2
answers

Does not show the 1 row of the empty array using angularJS asp.net mvc?

I have the following code: <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!--inserindo a meta tag de keywords onde definimos as palavras chaves--> <meta name=...
asked by 30.12.2015 / 03:07
1
answer

Save php array to mysql database [duplicate]

I need to save an array in a field in the database table and I would like to know how best to do this if using serialize() and unserialize() or json_encode() and json_decode() . I know you have other alternativ...
asked by 02.09.2015 / 04:18
3
answers

Compare values of an array

I have an array and in this array I have some dates, and I need to print the dates that are repeated. In order to get this data I created a for the size of the array, and within that for I made another loop in case one is also to be able to comp...
asked by 05.07.2015 / 08:28
2
answers

How to remove level 1 keys using only one Callback method

I do not want to use foreach and for . For example, I have the following array structure: Array ( [0] => Array ( [0] => Array ( [id_usuario] => 1 )...
asked by 27.10.2015 / 20:24