Having the following code is there a leaner way of initializing the array from 1 to the number especified by a variable?
int nums=5; int[] array= new int[num
Maybe I'm missing something here, but here is the best way I know of:
int[] data = new int [] { 383, 484, 392, 975, 321 };
from MSDN
even simpler:
int[] data = { 383, 484, 392, 975, 321 };