Answers for "push objet in array c#"

C#
1

c# add object to array

Array.Resize(ref objArray, objArray.Length + 1);
objArray[objArray.Length - 1] = new Someobject();
Posted by: Guest on May-17-2020
0

push c# array

for (int i = 0; i < myArray.Length; i++)
{
   if(myArray[i] == null)
   {
       myArray[i] = newValue;
       break;
   }
}
Posted by: Guest on October-30-2021

C# Answers by Framework

Browse Popular Code Answers by Language