Questions tagged as 'array'

2
answers

Saving some elements of an array in another array

I have defined an integer array in which it will be pointed to by a pointer and then I have another array that will store only a few numbers in which are even numbers. code ... void main(void) { srand(time(NULL)); //vetor de dimensao...
asked by 12.11.2015 / 15:18
1
answer

Adjacent values

I need to create an algorithm that calculates the minimum distance value between the indexes of an array containing adjacent values . But what are adjacent values could anyone give me examples? For example, in matrix A such that: A...
asked by 11.02.2016 / 20:57
2
answers

Foreach with PHP StdClass

My page shows posts that have been registered to the database. Some posts have files that have been uploaded. These files are saved in server folders and the database has the table "Pivot_files" with columns ID, Post, Name and Size. $postagens...
asked by 23.11.2016 / 08:34
1
answer

Transform mysql query into list

I'm doing a query on a database that returns a list of users, which I'm printing to a table. I would like to turn this query into a list and then insert those users into another table I make the query as follows: $sql= mysqli_query($con...
asked by 29.01.2016 / 13:26
1
answer

How can I add elements in a multidimensional array?

How do I add elements to a multidimensional array. For example instead of creating an array in PHP like this: $i = 0; $aArray[$i]['title'][] = 'teste'; $aArray[$i]['link'][] = 'teste de link'; Being able to do so $aArray[$i] = array( 'tit...
asked by 27.07.2015 / 18:07
1
answer

How to group dates coming from an array?

I have a function here to do and I do not even know where to start: I have an array of dates to group: array (size=12)<br> 0 => string '2016-08-22' (length=10)<br> 1 => string '2016-08-23' (length=10)<br>...
asked by 14.06.2016 / 20:27
3
answers

Problem adding a date to an array index

I am passing a date into an index of a Array . As looping is performed, this Array is being fed. The index is also generated through this looping. However, when starting the index, it displays only 1 character (as if it were "fragme...
asked by 28.08.2015 / 14:36
1
answer

How to pass an array as parameters or arguments?

I have two functions: function example($param1, $param2) { echo $param1 . $param2; } function frutas($fruta1, $fruta2, $fruta3) { echo $fruta1 . $fruta2 . $fruta3; } I also have a variable that gets the parameters of the functions...
asked by 28.05.2016 / 01:17
1
answer

Array without repetition

How do you not repeat the data with each execution? Each time I run it, it ends up repeating the dates at the time of execution, as I do for it to sort the dates without repeating them, and when the number of dates available in this collectio...
asked by 01.10.2015 / 14:37
1
answer

I can not display the names of people over the age of 18

/*Escreva um programa que receba o nome, profissão e a idade de 10 pessoas, calcule e imprima a quantidade de pessoas maiores de idade (idade >= 18 anos) e seus respectivos nomes.*/ #include <iostream> #include <locale.h> #include...
asked by 31.10.2015 / 18:17