Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How vb assigns an initial value to an array
How vb assigns an initial value to an array
Two methods

1. direct assignment, this method is only applicable to and small arrays.

Dim myArray() as Integer ={ 1,2,3,4,5}

Or Dim myArray(5) is an integer.

myArray(0)= 1

myArray( 1)=2

myArray(2)=3

Myanmar (3)=3

Myanmar (4)=5

Myanmar (5)=6

2. It is most commonly used for assignment in the next cycle.

Dim myArray () is an integer.

Integer = 0 to 5 for intCount.

MyArray(intCount)= the value to be allocated.

then

If you want everyone to be different, that's it:

Dim myArray () is an integer.

Dim FuZhi is an integer.

Give it a value of 0 to 5.

Integer = 0 to 5 for intCount.

Myanmar (intCount)=fuzhi

Next intCount

The next fuzhi