Questions tagged as 'array'

2
answers

Problems in implementing methods

I have the following classes: Port package meu.programa; public class Porta { boolean aberta; String cor; double dimensaoX; double dimensaoY; double dimensaoZ; void abre() { if (aberta == false) {...
asked by 18.08.2014 / 03:19
1
answer

How to organize an array from a list

An array that looks like this: Array ( [nome_e_sobrenome] => Array ( [0] => Luiz Felipe Machado [1] => Maria Rita de Cássia ) [usuario] => Array...
asked by 24.02.2017 / 19:44
2
answers

Remove comma from the last foreach value in PHP [duplicate]

Good morning, I have a foreach in my system and I need to separate the pro comma items, so the foreach is like this foreach($value as $item){ echo $item . ','} The result obviously comes out: 1,2,3, How do I get this last comma, r...
asked by 05.09.2016 / 16:04
1
answer

Delete item from an array and reorder it - PHP

It is the following: I have an array, more or less like this: $array = [ [0] => 'Fellipe', [1] => 'Fábio', [2] => 'Mateus', [3] => 'Gustavo' ]; I would like it when I remove an item from this array: unset ($ ar...
asked by 24.04.2017 / 06:11
3
answers

Print a character in place of a number

#include<stdio.h> #include<string.h> int main() { char str[50]; int i, l = 0; printf(" We will count the number of letters\n"); printf("-------------------------------------\n"); printf("Tell me the word: \n");...
asked by 22.12.2016 / 00:16
2
answers

How to use vectors / arrays in Java?

Hello, I am very lay in Java and I need to use one variable storing several others. How can I do this? I have the following: LatLng ponto1 = new LatLng(-19.924312,-43.931762); LatLng ponto2 = new LatLng(-18.851388,-41.946910); I'm used to C...
asked by 08.10.2016 / 04:24
2
answers

How to sort this php array?

I have this array: $res = array(); $res[] = array("16/08/2013", "13:32", "ROBERTO"); $res[] = array("16/08/2013", "13:16", "AMANDA"); $res[] = array("14/08/2013", "12:36", "SILMARA"); $res[] = array("14/08/2013", "", "ROBERTO"); $res[] = array...
asked by 09.07.2016 / 23:25
3
answers

Multidimensional array of different types

I have a view in the bank of my application where I count the user's name, his sector and the total number of records issued (tale from another table):    TotalPorUsuario (View) Table       Columns: name (string), sector (String), total (i...
asked by 15.03.2016 / 15:20
3
answers

Find sum of values in array

I need to develop an algorithm that finds a specific value of the sum of some elements of an array. Ex: I have an array with 50 distinct values and I have a given value "X" . I know that the sum of the combination of some elements of this...
asked by 02.10.2014 / 13:57
2
answers

Problem inserting data into a vector

I have the classes Port, Building and main: public class Porta { boolean aberta; String cor; double dimensaoX, dimensaoY, dimensaoZ; void abre() { this.aberta = true; } void fecha() { this.aberta = false; } void pinta(String cor) {...
asked by 24.05.2015 / 03:47