tagged [arrays]

Populate list from array

Populate list from array if i have an array. can i populate a generic list from that array:

1 Apr at 01:53

C# Permutation of an array of arraylists?

C# Permutation of an array of arraylists? I have an ArrayList[] myList and I am trying to create a list of all the permutations of the values in the arrays. EXAMPLE: (all values are strings) The count...

2 Apr at 17:16

What is the best way to clear an array of strings?

What is the best way to clear an array of strings? What is the best way to clear an array of strings?

3 Apr at 13:29

Using arrays or std::vectors in C++, what's the performance gap?

Using arrays or std::vectors in C++, what's the performance gap? In our C++ course they suggest not to use C++ arrays on new projects anymore. As far as I know Stroustroup himself suggests not to use ...

6 Apr at 16:24

Postgres - How to check for an empty array

Postgres - How to check for an empty array I'm using Postgres and I'm trying to write a query like this: i.e. I want to know how many rows have an empty array for a certain column, but postgres doesn'...

11 Apr at 14:9

How to copy a row of values from a 2D array into a 1D array?

How to copy a row of values from a 2D array into a 1D array? We have the following object which is only used with a fixed first index ``` int iIndex = 5; for (int iLoop = 0; iLoop

28 Apr at 11:11

returning IList<T> vs Array in C#?

returning IList vs Array in C#? I was recently asking someone why he preferred to return a strongly-typed array over an IList. I had always thought that programming against an interface was the most f...

2 May at 23:46

PHP foreach loop through multidimensional array

PHP foreach loop through multidimensional array I have an array: ``` $arr_nav = array( array( "id" => "apple", "url" => "apple.html", "name" => "My Apple" ), array( "id" => "orange",...

Javascript swap array elements

Javascript swap array elements Is there any simpler way to swap two elements in an array?

16 May at 12:10

Converting from a jagged array to double pointer in C#

Converting from a jagged array to double pointer in C# Simple question here: is there any way to convert from a jagged array to a double pointer? e.g. Convert a `double[][]` to `double**` This can't b...

Elegant way to go from list of objects to dictionary with two of the properties

Elegant way to go from list of objects to dictionary with two of the properties i seem to write this code over and over again and wanted to see if there was a better way of doing it more generically. ...

C#: Store byte array in XML

C#: Store byte array in XML What would be a simple way to store a Byte[] array in XML (using C#) ?

2 Jun at 06:1

C#: Nonzero-based arrays are not CLS-compliant

C#: Nonzero-based arrays are not CLS-compliant I am currently reading 's [C# 3.0 in a Nutshell](https://rads.stackoverflow.com/amzn/click/com/0596527578) and on pg. 241, whilst talking about Array ind...

5 Jun at 15:6

Are arrays or lists passed by default by reference in c#?

Are arrays or lists passed by default by reference in c#? Do they? Or to speed up my program should I pass them by reference?

8 Jun at 22:45

View array in Visual Studio debugger?

View array in Visual Studio debugger? Is it possible to view an array in the Visual Studio debugger? QuickWatch only shows the first element of the array.

Find First Specific Byte in a Byte[] Array c#

Find First Specific Byte in a Byte[] Array c# I have a byte array and wish to find the first occurance (if any) of a specific byte. Can you guys help me with a nice, elegant and efficient way to do it...

10 Jun at 10:57

Judy array for managed languages

Judy array for managed languages [Judy array](http://en.wikipedia.org/wiki/Judy_array) is fast data structure that may represent a sparse array or a set of values. Is there its implementation for mana...

15 Jun at 19:55

C#: Cleanest way to divide a string array into N instances N items long

C#: Cleanest way to divide a string array into N instances N items long I know how to do this in an ugly way, but am wondering if there is a more elegant and succinct method. I have a string array of ...

17 Jun at 18:28

Create c# object array of undefined length?

Create c# object array of undefined length? I would like to create an object array in C# of undefined length and then populate the array in a loop like so... ``` string[] splitWords = message.Split(ne...

21 Jun at 00:40

Performance of Arrays vs. Lists

Performance of Arrays vs. Lists Say you need to have a list/array of integers which you need iterate frequently, and I mean extremely often. The reasons may vary, but say it's in the heart of the inne...

28 Jun at 08:43

Get array starting with offset

Get array starting with offset I am using C#, and it's rather annoying that I can't send an array starting from a certain point like in C++. suppose this code: this is a weird syntax for C# because we...

28 Jun at 22:26

Finding the last index of an array

Finding the last index of an array How do you retrieve the last element of an array in C#?

29 Jun at 06:15

c# assign 1 dimensional array to 2 dimensional array syntax

c# assign 1 dimensional array to 2 dimensional array syntax I want to do something like: is this somehow possible and what is the syntax? or I need to do this: ``` for (int i = 0; i

8 Jul at 16:52

Initialize a Jagged Array the LINQ Way

Initialize a Jagged Array the LINQ Way I have a 2-dimensional jagged array (though it's always rectangular), which I initialize using the traditional loop: ``` var myArr = new double[rowCount][]; for ...

Convert byte array to short array in C#

Convert byte array to short array in C# I'm currently reading a file and wanted to be able to convert the array of bytes obtained from the file into a short array. How would I go about doing this?

9 Jul at 15:23