i have code in c
float var[4][3]={ {0.6,2,0.5}, {0.9,3,0.8}, {3,2,1.2}, {6,2,1}, }; i call variable var[1][1] , result 3
in swift have
let var : [[float]] = [ [0.6,2,0.5], [0.9,3,0.8], [3,2,1.2], [6,2,1], ] but can't call specific number. what's wrong? idea? thanks.
just change variable name var. it's keyword in swift.
let arr : [[float]] = [ [0.6,2,0.5], [0.9,3,0.8], [3,2,1.2], [6,2,1], ] print(arr[1][1]) // 3
Comments
Post a Comment