int[] x = new int[size];
You
must know the size of the array.
If you want something that
sort of works like an array that grows
automagically as items are entered then you can use:
Dictionary<int,int> x = new Dictionary<int,int>();
However it will still throw an exception on references to items that were never set.
EDIT: based on comments and other Solutions:
Re: default value
The simplest way to do this for the int[] is using the
Enumerable
methods (from Linq):
int[] x = Enumerable.Repeat(your_default_value, number_of_elements_in_array).ToArray();