Index out of range in multidimensional array in Swift -


this question has answer here:

var tri = [[int]](); tri[0][0] = 321; 

this code causes error:

fatal error: index out of range 

what's wrong?

you're accessing first element of first subarray of array. array doesn't contain subarrays, crashes.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

php - Cannot override Laravel Spark authentication with own implementation -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -