This question already has answers here:
Differences between a multidimensional array "[,]" and an array of arrays "[][]" in C#?
(12 answers)
Closed 4 years ago.
While coding a server, I came across something that I didn't recognize, which is byte[][].
What does this syntax mean, and how do I get rid of the message?
It's a Jagged Array in C#. To be short, it's an Array of Arrays holding bytes.
Related
This question already has answers here:
Differences between a multidimensional array "[,]" and an array of arrays "[][]" in C#?
(12 answers)
Closed 5 months ago.
I'm having some trouble creating a 2D array game object.
I would write in Java
Gameobject[][] gameobjects= new Gameobject[x][y];
As far as I know, c# is based on Java and much works like in Java. But I'm having some troubles when creating a 2D array gameobject because it shows me an error in the second dimension parameter
I couldn't find anything about my problem on YouTube, so I hope you can help me.
https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/multidimensional-arrays
So, for your case...
Gameobject[,] gameobjects= new Gameobject[x,y];
This question already has answers here:
change array size
(15 answers)
How to resize multidimensional (2D) array in C#?
(7 answers)
Closed 9 months ago.
I'm tying to create an method which accepts two parameter and rewrite them by increasing their memory space by one
public void expand(string[] array,double[,] data)
{
}
This question already has answers here:
What does it mean when there is a comma inside an array declaration? e.g. float[,]
(4 answers)
Closed 2 years ago.
So I'm trying to learn from other peoples code and I saw this at the end of a list and could not find it anywhere I looked
List<IMyShipMergeBlock>[,] merges = new List<IMyShipMergeBlock>[3, 2];
What is [,] and [3,2] called and could you point me to where I could learn more about it thanks
its a multidimensional array of List<IMyShipMergeBlocks>
The [3,2] is the initialiser for the array
so imagine a 3x2 grid and in each square there is a space for a List<IMyShipMergeBlocks>
EDIT: And important to note: You would then need to initialise each list separately as with the above you have an array of nulls to start with
This question already has answers here:
C# memcpy equivalent
(7 answers)
memcpy function in c# [duplicate]
(6 answers)
Closed 8 years ago.
I want to convert the code from C++ to C#, there is one line code regarding with memcpy. Not sure how to convert it.
memcpy(Bucket, nBucket, 4 * L);
The original code is from TopCoderForums. I finished most of them except a few lines.
In that specific example of code (where Bucket and nBucket are int arrays) here is what you can do in c#:
Array.Copy(nBucket, Bucket, 4 * L)
(Note that I think souce and destination should be swapped around)
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Convert string[] to int[] in one string of code using LINQ
I have an array of strings I want to convert it to array of int
is there any way to convert it directly without looping
I mean without use foreach, for , LINQ select statement, etc.
Any suggestion please.
Array.ConvertAll: http://msdn.microsoft.com/en-us/library/exc45z53.aspx