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

Home Posts Topics Members FAQ

3d array: what does this notation mean?

C#: cubearray??

int[ , , ] cubeArray = {{{7, 2}, {1, 4}}, {{3, 5}, {4, 4}}};

How do I interpret the above array statement?

regards,
Frank
Nov 16 '05 #1
3 4388

cubeArray[1,1,1] = 7
cubeArray[1,1,2] = 2
cubeArray[1,2,1] = 1
cubeArray[1,2,2] = 4
cubeArray[2,1,1] = 3
cubeArray[2,1,2] = 5
cubeArray[2,2,1] = 4
cubeArray[2,2,2] = 4

Robby
VB.Net
"Frank" <no@spam.org> wrote in message
news:41**********************@news.xs4all.nl...
C#: cubearray??

int[ , , ] cubeArray = {{{7, 2}, {1, 4}}, {{3, 5}, {4, 4}}};

How do I interpret the above array statement?

regards,
Frank

Nov 16 '05 #2
Arrays are 0-based in C#, so 1 must
be subtracted from every index as written.
First is therefore cubeArray[0,0,0] = 7;
--
Grace + Peace,
Peter N Roth
Engineering Objects International
http://engineeringobjects.com
Home of Matrix.NET
"Robby" <ed****@not.my.email.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...

cubeArray[1,1,1] = 7
cubeArray[1,1,2] = 2
cubeArray[1,2,1] = 1
cubeArray[1,2,2] = 4
cubeArray[2,1,1] = 3
cubeArray[2,1,2] = 5
cubeArray[2,2,1] = 4
cubeArray[2,2,2] = 4

Robby
VB.Net
"Frank" <no@spam.org> wrote in message
news:41**********************@news.xs4all.nl...
C#: cubearray??

int[ , , ] cubeArray = {{{7, 2}, {1, 4}}, {{3, 5}, {4, 4}}};

How do I interpret the above array statement?

regards,
Frank


Nov 16 '05 #3
opps .. You are soo right. They are 0 based in VB.Net also. I don't know
what I was thinking. I must have reverted to my VB6 days.

Robby

"Peter N Roth" <re***********@mycompany.com> wrote in message
news:ei**************@TK2MSFTNGP14.phx.gbl...
Arrays are 0-based in C#, so 1 must
be subtracted from every index as written.
First is therefore cubeArray[0,0,0] = 7;
--
Grace + Peace,
Peter N Roth
Engineering Objects International
http://engineeringobjects.com
Home of Matrix.NET
"Robby" <ed****@not.my.email.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...

cubeArray[1,1,1] = 7
cubeArray[1,1,2] = 2
cubeArray[1,2,1] = 1
cubeArray[1,2,2] = 4
cubeArray[2,1,1] = 3
cubeArray[2,1,2] = 5
cubeArray[2,2,1] = 4
cubeArray[2,2,2] = 4

Robby
VB.Net
"Frank" <no@spam.org> wrote in message
news:41**********************@news.xs4all.nl...
C#: cubearray??

int[ , , ] cubeArray = {{{7, 2}, {1, 4}}, {{3, 5}, {4, 4}}};

How do I interpret the above array statement?

regards,
Frank



Nov 16 '05 #4

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

Similar topics

22
by: VK | last post by:
A while ago I proposed to update info in the group FAQ section, but I dropped the discussion using the approach "No matter what color the cat is as long as it still hounts the mice". Over the last...
7
by: Robert Mark Bram | last post by:
Hi All! How do you get the length of an associative array? var my_cars= new Array() my_cars="Mustang"; my_cars="Station Wagon"; my_cars="SUV"; alert(my_cars.length);
38
by: VK | last post by:
Hello, In my object I have getDirectory() method which returns 2-dimentional array (or an imitation of 2-dimentional array using two JavaScript objects with auto-handled length property - please...
2
by: Salman Khilji | last post by:
After reading all the FAQs, I cannot solve the following problem: I have a pointer of type double. I am supposed to 1) Allocate memory for it assuming that the pointer will be pointing to a...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
7
by: Sam Kong | last post by:
Hello! My question would not be very practical but just out of curiosity. In JavaScript, Array is a subclass of Object. Well maybe not exactly... but sort of... For normal objects, you can...
13
by: sathyashrayan | last post by:
Dear group, pls go through the following function definition: function at_show_aux(parent, child) { var p = document.getElementById(parent); var c = document.getElementById(child); var top ...
2
by: JJA | last post by:
I'm looking at some code I do not understand: var icons = new Array(); icons = new GIcon(); icons.image = "somefilename.png"; I read this as an array of icons is being built. An element of...
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: borophyll | last post by:
I have two questions. The first: does the declaration of an array parameter in a function prototype which uses the notation mean that the array must be a variable length array. That is, the...
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...
1
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,...
1
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...
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: 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
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.