473,399 Members | 4,254 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,399 software developers and data experts.

How can I extract a row of data from a 2 dimensional array

Seems a simple question, but I can't find a simple answer:

I have created a two dimensional array. I wish to send the data, a row at a time to a graph plotting routine which is expected a one dimension array.

I could create a temporary one dimensional array and populate from the original array and then pass it to the routine, but this would seem to be long winded (read slow), and may well give me problems, as the previous values in the temporary table are overwritten.

Is there a simple way to create a one dimensional array from a single row of a two dimensional array?

Many Thanks

Smurf
Jul 21 '05 #1
1 2544
Hey Smurf,

I'm not too sure there is a simpler way to go from two-dimensional to one
than what you mentioned. Is there any possibility of using a jagged array
instead of a 2-dim? You could then pass just that element.

You _MIGHT_ find it quicker to create a 2-dim that only has one row then use
the Array.Copy() or the CopyTo() methods to duplicate the desired section,
though it's not really a 1-dim now so may not work either.

Good luck,

John

"smurf" <sm***@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com...
Seems a simple question, but I can't find a simple answer:

I have created a two dimensional array. I wish to send the data, a row at a time to a graph plotting routine which is expected a one dimension array.
I could create a temporary one dimensional array and populate from the original array and then pass it to the routine, but this would seem to be
long winded (read slow), and may well give me problems, as the previous
values in the temporary table are overwritten.
Is there a simple way to create a one dimensional array from a single row of a two dimensional array?
Many Thanks

Smurf

Jul 21 '05 #2

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

Similar topics

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...
16
by: rguti | last post by:
Hi, How do I create a two dimensional array? I have created a one dimensional doing this: Dim laFields As ArrayList = New ArrayList How about to do a 2 dimensional?
1
by: smurf | last post by:
Seems a simple question, but I can't find a simple answer: I have created a two dimensional array. I wish to send the data, a row at a time to a graph plotting routine which is expected a one...
5
by: Diffident | last post by:
Hello All, I have a 2-dimensional array that I am storing as a session variable. I have no idea on how I can cast the session variable back to 2-dimensional array. Any pointers? Reference...
2
by: | last post by:
While I can extract the option value from the following: <Select name='Keystring' MULTIPLE> <option value='1' name='status'>Pending</option> ..... </select> I cannot seem to extract the...
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: fniles | last post by:
I need to store information in a 2 dimensional array. I understand ArrayList only works for a single dimensional array, is that correct ? So, I use the 2 dimensional array like in VB6. I pass the...
272
by: Peter Olcott | last post by:
http://groups.google.com/group/comp.lang.c++/msg/a9092f0f6c9bf13a I think that the operator() member function does not work correctly, does anyone else know how to make a template for making two...
5
by: =?Utf-8?B?aWxy?= | last post by:
Hi This is probably fairly simple but I am newish at programming and was wondering if someone can give me some advice on handling the following. I have an array with a large number of elements...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.