0

I have this type of array float[1][1][54][54]. If it possible to cast this array to float[54][54]? Maybe it`s possible to remove two first empty dimensions?

0

1 Answer 1

2

You can't cast it, but you can just assign the inner array to a new variable:

float[][][][] arr1 = new float[1][1][54][54];
float[][] arr2 = arr1[0][0];

Note that although they're separate variables, they actually share a reference to the same inner array, so they can't be modified separately.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.