Questions tagged as 'array'

1
answer

Determining sequence of numbers with bubble sort from a txt file in python?

I have an input file in txt with data type the following: 7 6 8 4 8 5 0 1 2 1 0 3 2 3 0 This file is about 3 students from a school. The first line is the age of these 3 students (the first column could be student1, the second...
asked by 17.07.2018 / 22:53
2
answers

Using links with PDO in PHP

I'm trying to create a PDO loop where I can choose the desired field to position it on the page. But the code I'm using is bringing all the fields in one go. My code looks like this: include("libraries/conn.php"); $sql = "SELECT content...
asked by 19.07.2018 / 16:29
1
answer

JsonConvert.DeserializeObject returns null

Follow json: [ { "id":"BKA-EU8IED8ZD21Q", "agencyNumber":"1", "accountNumber":"1", "holder":{ "thirdParty":false, "taxDocument":{ "number":"783.121.360-02", "type":"C...
asked by 29.08.2018 / 23:48
3
answers

Arrange array in alphabetical order

When I want to sort an array alphabetically based on an array field I do this: // Compara se $a é maior que $b function cmp($a, $b) { return $a['nome'] > $b['nome']; } // Ordena usort($produtos, 'cmp'); This works perfectly, but I w...
asked by 31.08.2018 / 15:20
3
answers

How to join values in common php array?

I have the array $vetor[0]['codigo'] = '1'; $vetor[0]['valor'] = '4'; $vetor[1]['codigo'] = '1'; $vetor[1]['valor'] = '2'; $vetor[2]['codigo'] = '2'; $vetor[2]['valor'] = '2'; I need to merge all values with equal codes. Doing the ab...
asked by 16.05.2018 / 18:04
2
answers

Using struct in C #

I have to record customer information. And I used struct to do this. Is it worth doing this? Is it good practice or not?     
asked by 02.06.2018 / 05:06
1
answer

How to assign array of characters in a structure?

The program reads 10 movies, each movie has genre name, and age rating, then the list; I can not assign array of string (I believe this is only this error) #include <stdlib.h> #include <stdio.h> #include <stri...
asked by 25.10.2018 / 22:37
2
answers

Return values from an array after a given key

I have an array with about 100 positions this way: [ { "1":{ "id":1262, "nome":"Fulano", "sobrenome":"de Tal" } }, { "2":{ "id":1263, "nome":"Beltrano", "sobrenome":...
asked by 10.06.2014 / 17:16
1
answer

Doubt about JS objects with array

I'm in doubt about how to make an object that has an array inside, I do not know if that's possible, but it goes more or less what I want to do: var produtos =[ { nome: "Sei lá", cor: azul, tamanho: [ M, G, GG] // não sei...
asked by 13.02.2018 / 16:41
1
answer

Plain text editor in C

I have the following proposed exercise:    Make a program that mimics a text editor. Initially you will read the data entered by the user (lines of text) and create a vector in memory where the texts provided by the user will be stored (text...
asked by 12.06.2018 / 04:41