Questions tagged as 'array'

2
answers

How to add variable to array [JS]

I have the following code: var newLat = markerElem.getAttribute('lat'); var newLng = markerElem.getAttribute('lng'); var locations = [ {lat: newLat, lng: newLng} ] I want to get the values of the variables newLat and newLng...
asked by 29.06.2018 / 15:55
2
answers

Is it possible to use Heredoc with special characters in an array?

I have a multidimensional array, as the example below shows, but I wonder if I can use a Heredoc in it, would it be possible? Could I include special non-escaped characters if I can use Heredoc ? $name_code = array ( array("Nome", "HER...
asked by 06.08.2016 / 18:38
1
answer

Generate 9-digit keys with Python

I would like to generate several values following the pattern XXX-XXX-XXX where all the possibilities will be generated, for example: 1 - 000-000-000 2 - 000-000-001 3 - 000-000-002 . . . x - 999-999-999 . . . x - 000-000-00A x - 000-00...
asked by 18.12.2017 / 23:04
1
answer

How to copy an array from struct to another array?

I have 2 arrays made from a struct : struct events { string Kind; int Time; int DurVal; int Chan; }; events e1[100] events e2[100]; How can I make a full copy of array e1 to e2 in a simple command?     
asked by 16.08.2018 / 02:38
2
answers

Values returned in comparison of strings in C

I was reading about header string.h functions in link and I came across with a strings function (very useful after all), such as strcmp(string1, string2) . Depending on the first character that does not match, that is, it i...
asked by 03.08.2018 / 23:26
2
answers

Highest odd number

I spent hours trying to solve it, I started to think that the problem might be in the compiler, since it returns a different (and wrong) number with every execution What could be the mistake? #include <stdio.h> #include <stdlib.h&g...
asked by 13.06.2017 / 21:04
3
answers

Error in indexes of an array

I'm trying to make a selection sort algorithm, just to train algorithms myself, to my see my logic is right about sorting, but it's returning me an error I do not understand. > Code: import java.util.Scanner; import java.util.Arrays; publ...
asked by 27.12.2018 / 18:21
1
answer

Send form data by array to PHP

Due to a need of the system we are working on, I need to send 3 fields as an array to a PHP. Example: <input type="text" name="name[]" /> <input type="text" name="name[]" /> <input type="text" name="name[]" /> What happe...
asked by 31.08.2016 / 22:37
3
answers

How to use a cookie as Javascript Array?

Doubt: I would like to know a way to use Cookie , as if it were a Array . Problem: I can not figure out how to do this. Example: Suppose I have a Array called Foo which would be as follows: var Foo = ["qua...
asked by 03.02.2014 / 14:34
2
answers

For loop does not start with Array

I'm new to AS3, and I'm trying to create a game for a course I'm doing, but I'm having trouble starting a loop that should test the collision between two objects called by AS3. As objects are called dynamically by AS3, I'm inserting them into...
asked by 07.02.2014 / 20:44