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

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -