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!

Another question : how to inherit from Array?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.