Questions tagged as 'array'

2
answers

Returning direct and array function string

What works: void *teste(); int main () { printf("\nRESULTADO: %s\n", teste()); return 0; } void *teste(){ return "Ponteiro"; } What goes wrong: void *teste(); int main () { printf("\nRESULTADO: %s\n", teste()); retu...
asked by 03.11.2017 / 15:11
2
answers

Find out if item is in array

How do I check if an item is in an array ? Ex: var Tabela : Array of String; begin Tabela[0] := 'Valor'; Tabela[1] := 'Value'; if Tabela[0] = 'Valor' then // do wathever; This would be the normal mode, but in a large array , it would tak...
asked by 18.10.2014 / 18:23
2
answers

How to add contiguous numbers to an array?

I have array of numbers being typed by the user, and I need to add the numbers of this array . import java.util.ArrayList; import java.util.Scanner; public class Questao3 { /*3.Fazer um algoritmo que: •Leia um número indeterminad...
asked by 07.01.2015 / 19:42
1
answer

How to create string vectors in java?

   "Make an algorithm to receive an integer n (number of students), an integer m (number of subjects), and nxm grades 0 to 10, which each student obtained in each discipline.       a) which (s) of course (s) students scored highest on average?  ...
asked by 29.11.2014 / 20:45
2
answers

How to sort numbers in an array?

I do not find the function to sort the numbers drawn more and more. <?php $resultado = array(); for ($i = 0; $i <= 5; $i++){ array_push($resultado,rand(1,60)); } print_r($resultado); # Exibe os números sorteados fora...
asked by 06.09.2015 / 12:11
1
answer

Pass Array as parameter to function

Make a program in C that reads an x value, dynamically create a vector of x elements and pass that vector to a function that will read the elements of that vector. Then, in the main program, the filled vector must be printed. In addition, before...
asked by 04.05.2016 / 16:36
1
answer

What is Array.GetLength for?

To know the size of a vector, I can only use nomedovetor.Length , right? I saw an example in a for structure, where GetLength(0) or GetLength(1) was used to capture the dimensions of a array of rows and columns....
asked by 31.05.2015 / 16:18
3
answers

Print the data of a vector in a struct

I want to make a birthday date registration system. The final doubt is: how do I print the anniversary: 1/12/1990, 12/2/1977, 09/13/1999 and 19/04/1987. They would be the examples of the printing of the dates, but I get several numbers that have...
asked by 14.11.2014 / 14:22
3
answers

Comparing an array element with a string

I need to create a function that gets an array and compare it to a string , outside the array , returning true if, and only if, at least twice the string exists outside the array . The output should look like this: Str2(["a", "b"...
asked by 10.10.2015 / 23:38
1
answer

Doubts with Arrays in C #

Good evening, everyone. I'm a beginner in programming and I have two questions: When a double-array in C # exists, each array position starts as null or zero? Is there a method that returns the last OCCUPIED position of an array? For ex...
asked by 15.12.2015 / 23:34