tagged [arrays]
Populate list from array
Populate list from array if i have an array. can i populate a generic list from that array:
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...
- Modified
- 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?
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 ...
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'...
- Modified
- 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
- Modified
- 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...
- Modified
- 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",...
- Modified
- 9 May at 08:46
Javascript swap array elements
Javascript swap array elements Is there any simpler way to swap two elements in an array?
- Modified
- 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...
- Modified
- 20 May at 20:45
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. ...
- Modified
- 1 Jun at 12:5
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#) ?
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...
- Modified
- 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?
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.
- Modified
- 9 Jun at 21:15
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...
- Modified
- 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...
- Modified
- 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 ...
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...
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...
- Modified
- 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...
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#?
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
- Modified
- 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 ...
- Modified
- 8 Jul at 18:14
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?