Kotlin/Native: How to instantiate an IntVar?

Viewed 80

The IntVar constructor takes a NativePtr as an argument.

How do I create an IntVar from Int?

1 Answers

You could try this:

memScoped {
  val intVar = alloc<IntVar>()
  intVar.value = 123
}

Check out value for more information

Related