I am trying to make an array which holds all the positive integers possible, I tried the following code and it allways throws out of memory exception.
private int[] AllIntegers()
{
int[] all = new int[int.MaxValue];
for (int i = 0; i < int.MaxValue; i++)
{
all[i] = i;
}
return all;
}
What I am doing wrong? or this is not possible at all?!