Questions tagged as 'array'

1
answer

How to transform an array from one dimension to two in Java?

I have a one-dimensional array of integers, like this: int[] a = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; And I want to turn it into an array of two dimensions, for example: [1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12] How...
asked by 07.03.2017 / 17:07
2
answers

How to print the number of days of each month using Array, String and byte?

I'm trying this code, but it does not work. public class MesDias { public static void main(String[] args) { // Array String byte String Mes = {Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov, Dez}; byte[] Di...
asked by 04.01.2017 / 15:24
2
answers

Error translating structure code from C ++ to C #

I'm trying to read a string from a process, I found this structure on the internet: struct name { wchar_t nome[32]; }; I did it this way: struct name { public char[] nome = new char[32]; } And I'm returning the following erro...
asked by 27.11.2017 / 22:13
1
answer

Why by "new Array" after the variable?

Why put new Array after the variable name? Example: var weatherPattern = new Array('Clouds', "raining", "clowdy");     
asked by 26.07.2017 / 18:06
1
answer

Character array does not write correctly

I'm doing a program to encrypt according to the Cipher of Caesar in Java. I came across the following problem in the code: package projects; import java.util.Scanner; public class Projects { public static void main(String[] args) {...
asked by 18.04.2017 / 16:21
2
answers

Enabling fields (array) with Jquery when checking checkbox

Good afternoon guys, once again I need your help for the following problem: Imagine the following form records below: <input id="check[1]" name="check[1]" type="checkbox" value=""> <input id="campo1[1]" name="campo1[1]" type="te...
asked by 23.09.2016 / 18:32
2
answers

Put a name depending on the number of the array

Let's say I have 4 variables: - Porto = 1 - Benfica = 2 - Sporting = 3 - Braga = 4 I have this code that makes me a shuffle of numbers in an array called "arr". Integer[] arr = {1,2,3,4}; Collections.shuffle(Arrays.asList...
asked by 16.03.2018 / 18:49
1
answer

How to access the data of a subArray with Javascript

I need to access the data of a subarray via javascript, I can currently access the contents of the entire array: WhatIneedtogetinthecaseiscodigoImpressorathatisinsidesubarrayimpressoraPedidobutIcannotfindanythingtohelpmewithit.ArrayContent:{...
asked by 02.06.2017 / 15:41
1
answer

How to merge an array?

I'm writing a program that merges the values of two arrays, with the same amount of values. The program receives as input the amount of values in each array. It then receives the values and, finally, prints the merged values, as follows: Entr...
asked by 10.04.2016 / 14:24
2
answers

Search array position from a given term without using the 'inArray'

In a given method, from my input, when typing "me" it checks if the fruit exists in this array: ['banana', 'melao', 'uva', 'melancia'] In this case, bring me (position 1 - melao and position 3 - watermelon). I've tried using inArray...
asked by 21.03.2016 / 15:57