相关疑难解决方法(0)

在Nim中创建对数组的引用

var b: array[5, int]

type
    ArrRef = ref array[5, int]

var c : ArrRef
echo repr(c) # nil
c = addr b # doesn't compile, says type is Array constructor, expected reference
Run Code Online (Sandbox Code Playgroud)

在Nim中,如何将引用传递给数组而不是传递值?到目前为止,请参阅上面的代码.

arrays pointers reference nim-lang

7
推荐指数
1
解决办法
1291
查看次数

标签 统计

arrays ×1

nim-lang ×1

pointers ×1

reference ×1