Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

memset alternative in c#

var arr = GenerateArray(3, 4,-1);
//  first is row, second is col
// third  determine type  of  data in array  as well as 
// what elements should we put to fill the array
public static T[][] GenerateArray<T>(int row, int Col,T value)
{
    var arr = new T[row][];

    for (int i = 0; i < row; i++)
    {
        arr[i] = new T[Col];
        for (int j = 0; j < Col; j++)
        {
            arr[i][j] = value;
        }
    }
    return arr;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity target frame rate 
Csharp :: where is c# used 
Csharp :: get folders in directory c# 
Csharp :: csproj include folder and files 
Csharp :: how to name GameObject in c# 
Csharp :: C# .net core convert string to enum 
Csharp :: c# letters only 
Csharp :: unity rotation 
Csharp :: c# number in range 
Csharp :: if unity 
Csharp :: hashset to list c# 
Csharp :: how to make a singleton in unity 
Csharp :: wpf richtextbox clear text 
Csharp :: how to print dictionary in c# 
Csharp :: palindrome number c# 
Csharp :: C# get key by value Dict 
Csharp :: create list with values c# 
Csharp :: = in c# 
Csharp :: how to make unity build to not be full screen 
Csharp :: unity check if other object is colliding 
Csharp :: good food 
Csharp :: system.windows.forms not found 
Csharp :: o(n*m) 
Csharp :: movetowards unity 
Csharp :: list clone - C# 
Csharp :: how to store an array inside an array c# 
Csharp :: c# Get all class by namespace 
Csharp :: remove adjacent duplicate characters 
Csharp :: how to get the transform of an object in unity 
Csharp :: httpcontext in .net standard 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =