3D array access

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2008
Posts: 2
Reputation: hcra is an unknown quantity at this point 
Solved Threads: 0
hcra hcra is offline Offline
Newbie Poster

3D array access

 
0
  #1
May 16th, 2008
Hello. As we all know, to access an array you need to give 3 ints, like 3DArray[5, 2, 1]. I wonder, whether there is a way to access it with a single element, like
x = { 5 ,2 1}, 3DArray[x].
I think of creating a struct with 3 ints and overloading the []operator, however maybe this already is somehow implemented.
Another question is whether I can make an array starting with index -1? I'm creating sort of a game and need a spare plane (sort of a sentinel) at each side of the array to avoid checking unnecessary conditions. If not, are there any ways to overcome it? I think overloading []operator would come in handy.
Thanks!
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 2
Reputation: hcra is an unknown quantity at this point 
Solved Threads: 0
hcra hcra is offline Offline
Newbie Poster

Re: 3D array access

 
0
  #2
May 16th, 2008
Another question : how to inherit from Array?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC