1

I'm trying to be able to alter the size of an array based on a variable. I was thinking I might maybe later make it a 2D array. I don't want to use arraylist.

int i = 4;
int[] arr = new int[i];

How do you get something like this to work? It gives me error CS0236.

1 Answer 1

1

You have to make the int static

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.