Top "Arrays" questions

An array is an ordered linear data structure consisting of a collection of elements (values, variables, or references), each identified by one or more indexes.

How to convert a char array to a string?

Converting a C++ string to a char array is pretty straightorward using the c_str function of string and then …

c++ string char arrays
What’s the difference between "Array()" and "[]" while declaring a JavaScript array?

What's the real difference between declaring an array like this: var myArray = new Array(); and var myArray = [];

javascript arrays declaration
How to create a generic array in Java?

Due to the implementation of Java generics, you can't have code like this: public class GenSet<E> { private …

java arrays generics reflection instantiation
Converting a JS object to an array using jQuery

My application creates a JavaScript object, like the following: myObj= {1:[Array-Data], 2:[Array-Data]} But I need this object as an array. …

javascript jquery arrays object
How to push both value and key into PHP array

Take a look at this code: $GET = array(); $key = 'one=1'; $rule = explode('=', $key); /* array_push($GET, $rule[0] =&…

php arrays
Return array in a function

I have an array int arr[5] that is passed to a function fillarr(int arr[]): int fillarr(int arr[]) { for(...); …

c++ arrays pointers function return
Numpy array dimensions

I'm currently trying to learn Numpy and Python. Given the following array: import numpy as np a = np.array([[1,2],[1,2]]) Is …

python arrays numpy dimensions
How to randomize (shuffle) a JavaScript array?

I have an array like this: var arr1 = ["a", "b", "c", "d"]; How can I randomize / shuffle it?

javascript arrays random shuffle
How to determine if Javascript array contains an object with an attribute that equals a given value?

I have an array like vendors = [{ Name: 'Magenic', ID: 'ABC' }, { Name: 'Microsoft', ID: 'DEF' } // and so on... ]; How do I …

javascript arrays
How to solve PHP error 'Notice: Array to string conversion in...'

I have a PHP file that tries to echo a $_POST and I get an error, here is the code: …

php html arrays