473,414 Members | 1,665 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,414 software developers and data experts.

How to create custom 2 dimensional array data structure

Please provide me suggestions or any pointers.

I want to create a user defined data structure, which will be a 2 dimensional array such that each individual square of this 2-dimensional array will also store the score and the grades. ( Iam using VB.NET)

More details:



for example: There is an 2 dimensional array with 3 columns and 2 rows, I want to fill each of the

(0,0);(0,1);(0,2) with their own score (Integer type) and grades (String Type).

And this is same for the rest of the squares i.e. (1,0);(1,1);(1,2) and (2,0);(2,1);(2,2)



After creating such custom data structure: "CustomArray", I should be able to create the instance of this custom data structure (which will be a class) and code something like this:

Dim objCustomArray as CustomArray

objCustomArray = New CustomArray

for i as Integer =0 to 3

objCustomArray(0,i).SetScore(1)
objCustomArray(0,i).SetGrade("Good")

Next

for i as Integer =0 to 3

Dim myVal as Integer = objCustomArray(0,i).GetScore()

Dim myGrade as String = objCustomArray(0,i).gettGrade()

Next
Feb 20 '10 #1
2 3763
I have to create a use defined data structure where I need to store
an integer and a string value in each square of a 2 dimensional array.

I was wondering if it is possible to store hash data structure? something 2 dimensional array of hashes.

I know that we can add user defined objects to the ArrayList, is something like this possible with 2 dimensional array as that can be one more solution.

Please suggest.

Thanks.
Feb 20 '10 #2
tlhintoq
3,525 Expert 2GB
Please read the posting guidelines.

We can't help you with your schoolwork.
Please don't double post your messages. Your two threads have been merged.
Feb 21 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: fivelitermustang | last post by:
Actually, how would I go about allocating a four-dimensional dynamic array? I only know how to make two dimensional dynamic arrays: double **v; v = new double*; for (int i=0; i<C; i++) { v =...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
6
by: Ruben | last post by:
I'm trying to pass an array of string to a function without knowing how many strings I have beforehand. I've defined one functions as char * insert(char table,int cols, char values); out of...
1
by: PontiMax | last post by:
Hi, is there a recommendable data structure for dynamic two-dimensional arrays? The data structure should meet the following requirements: - The number of rows is unknown on initialization....
3
by: vvenk | last post by:
Hello: Is is possible to declare a 2-dimensional array, the first dimension being an Integer and the 2nd dimension another data type, say string? Or, is this a bad choice and a dataset may be...
6
by: Chuck Anderson | last post by:
My knowledge of JavaScript is limited. I learn from example and then adapt those examples to suit my needs. I have stumped myself on this one. I have a form with checkboxes that I want to...
10
by: SM | last post by:
Hello I'm trying to create a multi dimensional array in JavaScript, but after some reading i still can't figure out how to apply it to my model. Here it is: I have a list A and for each item...
4
by: Gernot Frisch | last post by:
Hi, I need a class, that has a 4 dimensional array (can be 3 dimensional, too) with such an operator: T operator()(int x1, int x2=0, int x3=0, int x4=0); that can be used as:
1
by: RequieM | last post by:
Hi, I am currently tearing my hair out trying to figure out how to effectivly parse a set of XML data I have in to an Arraylist of Custom Objects. I am unsure of the best method, whether to use...
19
by: John Whitworth | last post by:
Hi, Firstly, apologies if what I am asking seems really obvious. I'm a self-taught VB2008 (via VB4, VB6 and VB2003) user, and have always just picked up what I need to know, when I need to know...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.