multidimensional array of structures

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi! i want to ask: how do i declare a constant multidimensional array of
structures?
i have this c code (see code snippet below) and i want to covert it to
vb.net code

c code:
struct S_CODE{
int index;
double fs;
};

struct S_CODE s_code[10][10] = { {1,1.0},{2,2.1}....},{{2,9.1},....


TIA
 
Randy,
Have you tried something like:

Structure S_CODE
Public index As Integer
Public fs As Double

Public Sub New(ByVal index As Integer, ByVal fs As Double)
Me.index = index
Me.fs = fs
End Sub

End Structure

Dim s_codes As S_CODE(,) = {{New S_CODE(1, 1.0), New S_CODE(2, 2.1)}, _
{New S_CODE(2, 9.1),
New S_CODE(2, 9.2)} _
}


--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


| hi! i want to ask: how do i declare a constant multidimensional array of
| structures?
| i have this c code (see code snippet below) and i want to covert it to
| vb.net code
|
| c code:
| struct S_CODE{
| int index;
| double fs;
| };
|
| struct S_CODE s_code[10][10] = { {1,1.0},{2,2.1}....},{{2,9.1},....
|
|
| TIA
 
Back
Top