c# length of array
// declares a 1D Array of string.
string[] weekDays;
// allocating memory for days.
weekDays = new string[] {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
// Display length of array.
Console.Write(weekDays.Length);
c# length of array
// declares a 1D Array of string.
string[] weekDays;
// allocating memory for days.
weekDays = new string[] {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
// Display length of array.
Console.Write(weekDays.Length);
how to declare an array lenght in c#
public int[] number = new int[2 /* the number here declares the lenght, not the index*/ ];
int[1 /*this number here declares the index*/] = 69;
how to get an arrays length in c#
int array[] array;
int index;
public void func(){
for(int i; i < array.Length;i++){
index++;
}
Console.Write(index);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us