Multidimensional arrays in Swift

后端 未结 7 972
离开以前
离开以前 2020-11-30 22:43

Edit: As Adam Washington points out, as from Beta 6, this code works as is, so the question is no longer relevant.

I am trying to create and iterate through a two d

7条回答
  •  庸人自扰
    2020-11-30 23:04

    You are creating an array of three elements and assigning all three to the same thing, which is itself an array of three elements (three Doubles).

    When you do the modifications you are modifying the floats in the internal array.

提交回复
热议问题