Alex Rivera | Logout

How to clear an array

Asked 2010-04-20T08:04:17.773
30

I have a global variable int[] and I want to clear its data and fill it again in a loop.

How could this possible in C#?

Edit
Report

1 Answer

3

Wouldnt it be easier to use a list instead.

public List<int> something = new List<int>();

And then:

something.Add(somevalue);

And to clear:

something.Clear();
answered 2010-04-20T08:09:35.140

Your Answer