473,326 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

multidimensional array of structures

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
Nov 21 '05 #1
2 2217
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
"randy" <ra***@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
| 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
Nov 21 '05 #2
Thanks Jay! Your code worked! you are heaven-sent! thanks again!!

"Jay B. Harlow [MVP - Outlook]" wrote:
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
"randy" <ra***@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
| 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

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: TLOlczyk | last post by:
I have a brain cramp and I need some help. I have a chunk of code below which demonstrates a problem I have with multidimensional arrays. I want to keep it simple but something specific is...
10
by: Ole | last post by:
Goodday everybody, i want to create an array that represents data, that has to be transferred to a pdf doc ( iTextSharp ). The problem is, that i seem too loose my faith. Namely, ( i have...
1
by: Mark Smith | last post by:
I'm trying to copy data from a 1D array to a 2D array. The obvious thing doesn't work: int twoDee = new int; int oneDee = new int { 1, 2 }; Array.Copy(oneDee, 2, twoDee, 2, 2); This causes a...
2
by: chris | last post by:
Hi there, I created a Multidimensional array of labels Label lblMultiArray = new Label { {Label3, LblThuTotal}, {Label4,LblFriTotal} }; Now I would like to compare the values in the array,...
10
by: | last post by:
I'm fairly new to ASP and must admit its proving a lot more unnecessarily complicated than the other languages I know. I feel this is because there aren't many good official resources out there to...
1
by: Chuy08 | last post by:
If I have a multidimensional array like the following: Array $records =Array 0 = 30 year, 6.0; 1 = 30 year, 6.0; 2 = Pay Option, 1.0; 3 = Pay Option, 1.0; How could I flatten this to...
14
by: Michel Rouzic | last post by:
Hi, I've recently met issues with my program which can only be explained by heap corruption, so I've tried debugging my program with Valgrind, and here's what I get with the following...
5
by: LittleCake | last post by:
Hi All, I have a multidimensional array where each sub-array contains just two entries, which indicates a relationship between those two entries. for example the first sub-array: =Array ( =30...
4
Jezternz
by: Jezternz | last post by:
First of all I am open to any suggestions and advice. If a javscript multidimensional array is a bad way to do this please say so. I considered XML but I wondered if this would be a bad idea as it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.