473,412 Members | 2,306 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,412 software developers and data experts.

and array of arrays

82
hi everybody,
Its too simple, yet...
i would like to have an explanation for the following:
we represent the 2-d array as double[,] mydoubles = new double[2,2]
now what does the following mean?
I know its an array of arrays, a jagged array. but still i need convincing explanation for each of the lines
bool[][] mybools = new bool[2][]
mybools[0]=new bool[2];
mybools[1]=new bool[1];
Dec 9 '06 #1
2 942
bool[][] mybools = new bool[2][]
mybools[0]=new bool[2];
mybools[1]=new bool[1];
1st line : you declare 2d table with two rows..
2nd line: you declare that the first row has two columns
3rd line: you declare that the second row has one column

the double[,] declaration is for table where all rows have the same number of columns.. and in bool[][] as you can see each row can have different nuber of columns
Dec 11 '06 #2
aaryan
82
1st line : you declare 2d table with two rows..
2nd line: you declare that the first row has two columns
3rd line: you declare that the second row has one column

the double[,] declaration is for table where all rows have the same number of columns.. and in bool[][] as you can see each row can have different nuber of columns
Thank you seishin for your simply yet clear explanation.
Dec 12 '06 #3

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

Similar topics

13
by: Noah Spitzer-Williams | last post by:
Hello guys, I would like to do something seemingly simple: find out if an element in an array that is passed to my function exists. I used to think I could just do: if (arr) ... However, if...
5
by: Rave | last post by:
Is there a better way to do this in C++ ? linkedlist * sort_array; for(int i=0; i<MAX; i++) { sort_array = new (linkedlist); sort_array = new (linkedlist); }
5
by: JezB | last post by:
What's the easiest way to concatenate arrays ? For example, I want a list of files that match one of 3 search patterns, so I need something like DirectoryInfo ld = new DirectoryInfo(searchDir);...
1
by: Craig | last post by:
Hey Everyone - I'm trying to determine the fastest way of moving array information around and could use some help. Here's the setup: Class A stores a DateTime and an amount (a payment)....
7
by: cdg | last post by:
Would anyone explain how to return an array that wasn`t passed from "main" using a pointer. I'm not understanding how scope and memory are involved in this. However, I do know that there are two...
4
by: Bundy | last post by:
I am trying to create a function that executes all the functions listed in an array. I cannot get it to work. <html> <body> <script language="JavaScript"> var length_of_array = 2; var...
4
by: Olumide | last post by:
Hello - I have two classes A and B as follows: class B{ public: ~B(){ cout << "destroying B" << endl; } }; class A{
3
by: arnuld | last post by:
Stroustrup says: "Arrays are not self describing because the number of elements of an Array is not guarnteed to be stored with Array" "this implies that o traverse an Array that does not...
10
by: Ahmad Humayun | last post by:
Whats the difference between: char str1 = "wxyz"; char* str2 = "abcd"; I can do this: str2 = str1 but I can't do this: str1 = str2
14
by: =?Utf-8?B?RWR3YXJk?= | last post by:
Hi everybody, To me the following code shouldn't work but it does ! Imports system.String Dim x As String="This,is,a,test" Dim y(1) As String y=x.Split(",") TextBox1.text=y(3) why "Y" which is...
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?
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
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
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
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
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...

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.