473,473 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Two D Array list

14 New Member
Dear All

Could you please explain or refer some reading material on how to create two dimensional array lists ? and how to access the fields with columns and row indexes ?


Extremely appreciate your help
Maral
Oct 7 '07 #1
3 2837
JosAH
11,448 Recognized Expert MVP
Dear All

Could you please explain or refer some reading material on how to create two dimensional array lists ? and how to access the fields with columns and row indexes ?


Extremely appreciate your help
Maral
You can implement a two dimensional list as a list that contains (other) lists:
Since Lists are ordinary objects you can store those Lists in the 'major' list:

Expand|Select|Wrap|Line Numbers
  1. List<List<T>> matrix= new ArrayList<List<T>>();
  2.  
kind regards,

Jos
Oct 7 '07 #2
Ganon11
3,652 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. List<List<T>> matrix= new ArrayList<List<T>>();
  2.  
Out of curiosity, will you have to insert spaces with all those <'s and >'s, e.g.

Expand|Select|Wrap|Line Numbers
  1. List< List< T > > matrix= new ArrayList< List< T > >();
I know you have to do this in C++, as the compiler thinks you are using >>, the bit shift operator.
Oct 7 '07 #3
JosAH
11,448 Recognized Expert MVP
Out of curiosity, will you have to insert spaces with all those <'s and >'s, e.g.

Expand|Select|Wrap|Line Numbers
  1. List< List< T > > matrix= new ArrayList< List< T > >();
I know you have to do this in C++, as the compiler thinks you are using >>, the bit shift operator.
No there's no need to; I know C++ is a bit stupid w.r.t. this, i.e. it uses C's own
lexical analyzer (which is the stupid part); Sun managed to solve this little
idiosyncracy nicely in Java; no spaces are needed here.

kind regards,

Jos
Oct 7 '07 #4

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

Similar topics

6
by: Harry Overs | last post by:
My program needs to take a pointer to BYTE array (unsigned char*) and convert it into a STL list so that each BYTE in the array has its own element in the list, i.e. if the array has hundred bytes...
1
by: aemazing | last post by:
hello, im new to the forum and i wanted to help with my c++ program. the teacher wants us to design a progrm that would keep track of airplanes awaitin landing at an airport. the program will...
1
by: aemazing | last post by:
i've been tryin to do the following - -Add a new flight number to the end of the queue (got it done) -LAnd the plane at the front of the queue - problems wit it- -display the queue - got it done...
8
by: Peter B. Steiger | last post by:
The latest project in my ongoing quest to evolve my brain from Pascal to C is a simple word game that involves stringing together random lists of words. In the Pascal version the whole array was...
19
by: Tom Jastrzebski | last post by:
Hello, I was just testing VB.Net on Framework.Net 2.0 performance when I run into the this problem. This trivial code attached below executed hundreds, if not thousand times faster in VB 6.0...
1
by: cyrvb | last post by:
Hello, I'm a very very newbie in C# I did start 2 days ago, I get Visual Stuido 2005 C# I try to understand how to manage the arrays I did write this
10
by: javuchi | last post by:
I just want to share some code with you, and have some comments and improvements if you want. This header file allocates and add and delete items of any kind of data from a very fast array: ...
2
by: StevenChiasson | last post by:
For the record, not a student, just someone attempting to learn C++. Anyway, the problem I'm having right now is the member function detAddress, of object controller. This is more or less, your...
35
by: Lee Crabtree | last post by:
This seems inconsistent and more than a little bizarre. Array.Clear sets all elements of the array to their default values (0, null, whatever), whereas List<>.Clear removes all items from the...
4
by: Bob Bedford | last post by:
Hello, I've an array of array(1,2,3,4). I'd like to retrieve the values in 3 and 4 giving the values 1 and 2. How can I do that, how to search in an array of array ? in short, how to write the...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.