Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,940 questions

51,877 answers

573 users

How to create and use dynamic array of integers with VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()

        Dim r As Random = New Random

        Dim size As Integer = r.Next(1, 10)
        Dim arr() As Integer = {0}
        ReDim Preserve arr(size)

        For i As Integer = 0 To size
            arr(i) = r.Next(1, 100)
        Next

        For Each n As Integer In arr
            Console.WriteLine(n)
        Next

    End Sub

End Module


' run:
' 
' 54
' 40
' 67
' 2
' 18

 



answered Oct 1, 2018 by avibootz

Related questions

2 answers 232 views
4 answers 181 views
1 answer 103 views
2 answers 175 views
2 answers 218 views
...