A step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.
A C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.
This tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.
Creating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.
Jagged arraysThis tutorial explains what a jagged array by giving an example that shows you how set and retrieve values. |
On Sunday, July 25th 2004 at 11:34 PM By Andrew Pociu (View Profile) ![]() ![]() ![]() ![]() (Rated 4.6 with 16 votes) |
|||||
|
They say a jagged array is an array of arrays. It's not so hard to comprehend this. In the following example we declare jaggedArray named jArray that can hold 3 other arrays:
Next you can set the size (number of elements) of each of the 3 arrays:
The first array (0) has 2 elements, the second (1) has 5 elements and the third (2) has 7 elements. How do we assign and retrieve values from the elements of each array? As you can see in the followin graphic, first we specify the number of the array, second we specify the number of the element: ![]() In the following example we assign values to all the elements in all 3 arrays:
Using two loops we can retrieve the values of the elements from all the arrays inside the jagged array:
If you compile the code, here's the result in the console window:
|
||||||
Digg It!
Del.icio.us
Reddit
StumbleIt
Newsvine
Furl
BlinkList
|
||||||
|
||||||
Current Commentswhat's the GetLength do? i can't understand it properly
disantha,
The <array>.GetLength(x) ask the program how long the array in question is. (note: the x is which dimintion we are asking for.)
This is a beautiful job.
thanks
very very easy tutorial im highly impressed from the way Andrew brother illustrated and demonstrated jagged array and now i completely understand, i read 3 ebooks but didnt understand how to use jagged arrays untill now because of their technical jorgans and shitty examples with mathematical complexities :)
Thanks man - I concur with Haider :-). Still being used through 2011.
thx man, this is what i want to search
Use System.Windows.Forms.Cursor.Position to get the cursor position in screen coordinates.I admire the important information you offer within your content. I'll bookmark your web site and have my kids examine up the following typically.
Once you have recreated the problem and captured these steps, you can save them to a file and send it to your support person, who can then open it up and view
This article is very interesting, sharing is a wise choice, would like to see more about yourarticle
Thank you for sharing, I will often come to patronize your site
Much appreciated for the information and share!
Related Tutorials
Related Source Code
C# Job Search