Questions tagged as 'array'

2
answers

Remove duplicates of an array of JSON objects in javascript (Angular 5)

I am trying to eliminate the duplicate elements inside a json object that is in an array but I can not do it, try with filter and with map but it seems that I can not access the json object, that is, I refer to it, here I show a example of the a...
asked by 11.08.2018 / 20:31
1
answer

Iterate an array of characters in c

I want to print each element of the array but it generates a segmentation fault This is the code: #include <stdio.h> int main(){ char arreglo[3]={'c','f','d'}; char *puntero; puntero=arreglo; for(int i=0;i<3;i++){...
asked by 14.06.2018 / 23:11
1
answer

Return several indexes of an array in Swift 4

I would like to know how I can get several indexes within an array of strings or characters. An example: var arrayInput = ["2","+","3","(","2","-","4","(","3","*","5",")",")",] func isParentheses() { var count = 0 var arrayNumPar...
asked by 12.07.2018 / 21:19
1
answer

Compare two split strings of a FILE file

I am doing an exercise in which your goal is to enter a file with File, read it and check with a split if the two words that are between the symbol " | " are equal (letter by letter). I tried to do it with a "charAt" but it does not work out at...
asked by 10.06.2018 / 14:25
3
answers

reassign value to string

I have this assignment to a string: unsigned char cadena[] = {154,162,162,145,'unsigned char cadena[] = {154,162,162,145,'%pre%'}; '}; What is "hola" , but in decimal. How can I reassign another decimal value to the same variable c...
asked by 11.06.2018 / 20:24
2
answers

Extract data from an array

I have the following code: if (!$curld = curl_init($dominio)) { echo "Could not initialize cURL session.\n"; exit; } curl_setopt($curld, CURLOPT_RETURNTRANSFER, true); curl_exec($curld); echo "<pre>"; print_r(curl_getinfo($curld)...
asked by 22.06.2018 / 18:01
1
answer

Problem when extracting data

I have Menu (food) within those menus I have submenus (first, second, etc) and within submenus I have dishes. The submenus I generate them perfect and as soon as the dishes always fill them with the last dishes of the last submenu id with whi...
asked by 16.05.2018 / 15:54
1
answer

Receive and display an array of C # in JavaScript

I have an array of C # that I need to show when I enter a certain page. I am making a request with AJAX to receive this data. $.post({ url: '/Home/MostrarArray', success: function (datas) { console.log(datas);...
asked by 09.05.2018 / 11:12
1
answer

Draw an odd vector from a matrix. Python

n = int(raw_input("Ingrese N\n")) cont = 0 matriz = [] for i in range(n): matriz.append([0]*n) for i in range(n): for j in range(n): matriz[i][j] = int(raw_input("Elemento %d, %d : " % (i,j))) if(ma...
asked by 27.04.2018 / 03:47
1
answer

Object arrangement by several Classes?

I am a beginner in terms of OOP, and right now I am doing a code for a veterinarian where I have to make an arrangement of objects and put animal data. This is the parent class (which, as you can see is Abstract) package veterinaria;...
asked by 22.04.2018 / 18:07