PC Review


Reply
Thread Tools Rate Thread

3d array: what does this notation mean?

 
 
Frank
Guest
Posts: n/a
 
      30th Dec 2004
C#: cubearray??

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

How do I interpret the above array statement?

regards,
Frank
 
Reply With Quote
 
 
 
 
Robby
Guest
Posts: n/a
 
      30th Dec 2004

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" <(E-Mail Removed)> wrote in message
news:41d467ea$0$6207$(E-Mail Removed)...
> C#: cubearray??
>
> int[ , , ] cubeArray = {{{7, 2}, {1, 4}}, {{3, 5}, {4, 4}}};
>
> How do I interpret the above array statement?
>
> regards,
> Frank



 
Reply With Quote
 
Peter N Roth
Guest
Posts: n/a
 
      30th Dec 2004
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> 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" <(E-Mail Removed)> wrote in message
> news:41d467ea$0$6207$(E-Mail Removed)...
>> C#: cubearray??
>>
>> int[ , , ] cubeArray = {{{7, 2}, {1, 4}}, {{3, 5}, {4, 4}}};
>>
>> How do I interpret the above array statement?
>>
>> regards,
>> Frank

>
>



 
Reply With Quote
 
Robby
Guest
Posts: n/a
 
      31st Dec 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>
>> 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" <(E-Mail Removed)> wrote in message
>> news:41d467ea$0$6207$(E-Mail Removed)...
>>> C#: cubearray??
>>>
>>> int[ , , ] cubeArray = {{{7, 2}, {1, 4}}, {{3, 5}, {4, 4}}};
>>>
>>> How do I interpret the above array statement?
>>>
>>> regards,
>>> Frank

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array/Literal notation AA2e72E Microsoft Excel Programming 1 3rd Jun 2009 10:00 AM
Hungarian Notation Vs Pascal Notation? Grey Squirrel Microsoft Dot NET Framework 17 22nd Mar 2007 08:14 PM
Hungarian Notation Vs. Pascal Notation? Grey Squirrel Microsoft ASP .NET 6 21st Mar 2007 09:42 AM
Hungarian Notation Vs. Pascal Notation Grey Squirrel Microsoft Dot NET 3 19th Mar 2007 02:43 PM
array notation steven Microsoft VB .NET 3 28th Sep 2005 12:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:52 PM.