I have the following two dimensional array:
val arr = Array(3){column-> IntArray(5){it+column} }
i want to set the value 5 in the place arr[1][3] (index 1,3) so when i write the following code:
arr[1,3] = 5
I'm getting the following error:
The integer literal does not conform to the expected type IntArray
When trying to use IDE fix (Alt+Shift+Enter) it creates the following function:
private operator fun <T> Array<T>.set(i: Int, unit: Unit, value: Int)
Now i don't understand the meaning of the unit variable and don't know how implement this function
arr[1][3] = 5
instead of the comma? You don't need any custom operator for this - Joffrey