In this code:
Dim files() As String = Directory.GetFiles(\"C:/\")
Dim files As String() = Directory.GetFiles(\"C:/\")
is there a differenc
Both are the same
Dim files() As String = Directory.GetFiles("C:/")
Dim files As String() = Directory.GetFiles("C:/")
Both will declare an array and store all files name in C:\ directory
They produce exactly the same thing - just two alternative forms of declaration.
The two are identical. If you use Reflector, you can see that they are compiled to the same IL:
.field private string[] files
Actually, there is a difference. Example explains everything:
Class Demo
Property X() As Byte
Property Y As Byte()
End Class
...
Sub DemoCode()
Dim d As New Demo()
d.X = New Byte() {} ' !!! invalid
d.Y = New Byte() {} ' valid
End Sub