Jump to content

Quickly create literal arrays, how?


Recommended Posts

I hope I'm missing something but is there really no way to declare and create an array doing something like this;

int[] myArray = new {1, 2, 3, 4, 5, 6}

 

Or maybe ([1], [2], [3], [4], [5], [6])

 

I know the syntax is wrong, this should be viewed as pseudocode, I hope you get what I mean.

 

 

Because this

 

int[] myArray = new int[6]

myArray[0] = 1

myArray[1] = 2

And so on, is so damned slow.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...