How to use Structure (struct) in VB.NET

1 Answer

0 votes
Structure Test
    Public n As Integer
    Public d As Double
    Public b As Boolean
    Public s As String
End Structure

Module Module1

    Sub Main()
        Dim st As Test

        st.n = 984
        st.d = 3.14
        st.b = True
        st.s = "VB.NET"

        Console.WriteLine(st.n)
        Console.WriteLine(st.d)
        Console.WriteLine(st.b)
        Console.WriteLine(st.s)
    End Sub

End Module


' run:
' 
' 984
' 3.14
' True
' VB.NET

 



answered Oct 22, 2018 by avibootz

Related questions

2 answers 166 views
1 answer 147 views
1 answer 126 views
1 answer 119 views
1 answer 99 views
...