Home > database >  Program a small white
Program a small white

Time:10-04

How to assign the length of an array to an integer variable

CodePudding user response:

Suggest reading the code on the first, the basic code line by line according to knock, knock on their own thinking and memory, when

C #, for your reference:


 using System; 

The namespace HelloWorld2
{
Class Program
{
The static void Main (string [] args)
{
Int [] arr={1, 2};
Int len=arr. Length;
Console. WriteLine (" array length: {0} ", len);
The Console. The Read ();
}
}
}
  • Related