Answers for "initialize array with size c#"

C#
0

c# initialize empty array

datatype[] arr = new datatype[]{};
or
datatype[] arr = new datatype[0];
or
datatype[] array = {}
or
var a = Array.Empty<datatype>();
Posted by: Guest on June-16-2020
0

c# increase length of array

int[] myArray = { 1, 2, 3 };
Array.Resize(ref myArray, 5);
Posted by: Guest on November-05-2021
0

declare string array c# without size

List<string> myStringList = new List<string();
myStringList.Add("Test 1");
myStringList.Add("Test 2");
Posted by: Guest on May-22-2020

Code answers related to "initialize array with size c#"

C# Answers by Framework

Browse Popular Code Answers by Language