What is the difference between: int[][] arr; and int[,] arr;

Is there anydifference between to two?

Also if there is, which is preferred i.e. is one faster then the other?

thanks Alex

int[][] is an array of arrays, where array[0] could be 42 items long, and array[1] could have just 2 as each individual inner array can be created independently

int[,] has a predefined width and height (so you don't need to check bounds for each column), and is internally just one array, so is generally going to be slightly faster

Both have their uses though, so you may still want to try both to see which fits your use case better

cool thanks, well it's for a procedural sphere terrain set up in the editor. Performance will not be that important here (yet). Hehe the progressbar slows things down when creating 65000 verts

For grids the arr[,] would be preferred then. However I always use arr[ y * depth + x ] wich propably is a bit faster too. Not sure there

Alex