| | |
3D array access
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2008
Posts: 2
Reputation:
Solved Threads: 0
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!
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!
![]() |
Similar Threads
- Safe Array (C++)
- Constructing a multi-dimensional array using a dilimited string input. (PHP)
- Storing matrix into MS Access!!! (MS Access and FileMaker Pro)
- return array from a class (Java)
- Return a 2D array from a function (C++)
- Pointer to array (C++)
- 3d to 1d Array Conversion (C++)
- encapsulating an array in a class? (C#)
- Having problems saving objects into an array, then accessing the data later for repo (Java)
- bload something into an array (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: getting userinformation from ActiveDirectory
- Next Thread: cast text file to an array
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format formatting forms function gdi+ httpwebrequest image index input install java label list listbox listener mandelbrot marshalbyrefobject math mouseclick mysql networking object operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





